From b172f36bb334c9e469346bf2a2ce36c8e8d68acb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 10 Dec 2009 14:49:20 +0000 Subject: [PATCH] - add optflags patch; rel 1 Changed files: csstidy.spec -> 1.11 scons-optflags.patch -> 1.1 --- csstidy.spec | 10 ++++---- scons-optflags.patch | 57 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 scons-optflags.patch diff --git a/csstidy.spec b/csstidy.spec index e6be231..967d773 100644 --- a/csstidy.spec +++ b/csstidy.spec @@ -1,16 +1,15 @@ -# TODO -# - optlfags Summary: Open Source CSS parser and optimiser Summary(pl.UTF-8): Analizator i optymalizator CSS z otwartymi źródłami Name: csstidy Version: 1.4 -Release: 0.3 +Release: 1 License: GPL v2+ Group: Applications/WWW Source0: http://dl.sourceforge.net/project/csstidy/CSSTidy%20%28C%2B%2B%2C%20stable%29/1.3/%{name}-source-%{version}.zip -# Source0-md5: 7087cc0c6cfdb42a3e796621a5d12a09 +# Source0-md5: 8fcbf5c1c3cafd9232552b3286aabcb9 Source1: http://ftp.debian.org/debian/pool/main/c/csstidy/%{name}_%{version}-3.diff.gz -# Source1-md5: 8fcbf5c1c3cafd9232552b3286aabcb9 +# Source1-md5: 7087cc0c6cfdb42a3e796621a5d12a09 +Patch0: scons-optflags.patch URL: http://csstidy.sourceforge.net/ BuildRequires: libstdc++-devel BuildRequires: sed >= 4.0 @@ -36,6 +35,7 @@ przeznaczony do sprawdzania poprawności CSS. %{__gzip} -dc %{S:1} | %{__patch} -p1 %{__patch} -p1 < debian/patches/001_emptyfile.dpatch %{__patch} -p1 < debian/patches/002_gcc43fix.dpatch +%patch0 -p1 %build %scons diff --git a/scons-optflags.patch b/scons-optflags.patch new file mode 100644 index 0000000..6ad5157 --- /dev/null +++ b/scons-optflags.patch @@ -0,0 +1,57 @@ +--- csstidy-1.4/SConstruct~ 2009-12-10 16:46:51.000000000 +0200 ++++ csstidy-1.4/SConstruct 2009-12-10 16:46:55.184590309 +0200 +@@ -12,13 +12,24 @@ + #tell the user what we're doing + print '**** Compiling in ' + mymode + ' mode...' + +-debugcflags = ['-Wall', '-g', '-pedantic'] #extra compile flags for debug +-releasecflags = ['-O2'] #extra compile flags for release ++CXX = ARGUMENTS.get('CXX') ++CXXFLAGS = ARGUMENTS.get('CXXFLAGS') ++ ++if CXXFLAGS: ++ debugcxxflags = releasecxxflags = CXXFLAGS.split(' '); ++else: ++ debugcxxflags = ['-Wall', '-g', '-pedantic'] #extra compile flags for debug ++ releasecxxflags = ['-O2'] #extra compile flags for release ++ ++if CXX: ++ debugcxx = releasecxx = CXX ++else: ++ debugcxx = releasecxx = 'g++' + + env = Environment() + + #make sure the sconscripts can get to the variables +-Export('env', 'mymode', 'debugcflags', 'releasecflags') ++Export('env', 'mymode', 'debugcxx', 'debugcxxflags', 'releasecxx', 'releasecxxflags') + + #put all .sconsign files in one place + env.SConsignFile() +--- csstidy-1.4/csstidy/SConscript~ 2009-12-10 16:46:42.000000000 +0200 ++++ csstidy-1.4/csstidy/SConscript 2009-12-10 16:46:46.397716113 +0200 +@@ -3,8 +3,8 @@ + import glob + + #get all the build variables we need +-Import('env', 'project', 'mymode', 'debugcflags', 'releasecflags') +-localenv = env.Copy() ++Import('env', 'project', 'mymode', 'debugcxx', 'debugcxxflags', 'releasecxx', 'releasecxxflags') ++localenv = env.Clone() + + buildroot = '../' + mymode #holds the root of the build directory tree + builddir = buildroot + '/' + project #holds the build directory for this project +@@ -13,9 +13,11 @@ + #append the user's additional compile flags + #assume debugcflags and releasecflags are defined + if mymode == 'debug': +- localenv.Append(CCFLAGS=debugcflags) ++ localenv['CXX']=debugcxx ++ localenv.Append(CXXFLAGS=debugcxxflags) + else: +- localenv.Append(CCFLAGS=releasecflags) ++ localenv['CXX']=releasecxx ++ localenv.Append(CXXFLAGS=releasecxxflags) + + #specify the build directory + localenv.BuildDir(builddir, ".", duplicate=0) -- 2.44.0