#1 Switch to scons-3, with a build script patch
Merged 4 years ago by verdurin. Opened 4 years ago by pviktori.
rpms/ pviktori/minicomputer scons3  into  master

@@ -0,0 +1,75 @@ 

+ diff -rU3 MinicomputerV1.41-orig/SConstruct MinicomputerV1.41/SConstruct

+ --- MinicomputerV1.41-orig/SConstruct	2019-11-01 17:38:52.141938193 +0100

+ +++ MinicomputerV1.41/SConstruct	2019-11-01 17:41:06.219307341 +0100

+ @@ -1,6 +1,6 @@

+ -print" "

+ -print"Minicomputer-------------- "

+ -print"-                     1/2:configuring"

+ +print(" ")

+ +print("Minicomputer-------------- ")

+ +print("-                     1/2:configuring")

+  

+  if ARGUMENTS.get('64bit', 0):

+  	env = Environment(CCFLAGS = '-m64')

+ @@ -34,47 +34,47 @@

+  conf = Configure(env)

+  

+  if not conf.CheckLibWithHeader('jack', 'jack/jack.h','c'):

+ -	print 'Did not find jack, exiting!'

+ +	print('Did not find jack, exiting!')

+  	Exit(1)

+  if not conf.CheckLibWithHeader('lo', 'lo/lo.h','c'):

+ -	print 'Did not find liblo for OSC, exiting!'

+ +	print('Did not find liblo for OSC, exiting!')

+  	Exit(1)

+  if not conf.CheckLibWithHeader('asound', 'alsa/asoundlib.h','c'):

+ -	print 'Did not find alsa, exiting!'

+ +	print('Did not find alsa, exiting!')

+  	Exit(1)

+  if not conf.CheckLibWithHeader('pthread', 'pthread.h','c'):

+ -	print 'Did not find pthread library, exiting!'

+ +	print('Did not find pthread library, exiting!')

+  	Exit(1)

+  if not conf.CheckLibWithHeader('m', 'math.h','c'):

+ -	print 'Did not find math library, exiting!'

+ +	print('Did not find math library, exiting!')

+  	Exit(1)

+  env = conf.Finish()

+  

+ -print"-                    checking dependencies for the editor:"

+ +print("-                    checking dependencies for the editor:")

+  

+  guiconf = Configure(guienv)

+  if not guiconf.CheckLibWithHeader('lo', 'lo/lo.h','c'):

+ -	print 'Did not find liblo for OSC, exiting!'

+ +	print('Did not find liblo for OSC, exiting!')

+  	Exit(1)

+  if not guiconf.CheckLibWithHeader('fltk', 'FL/Fl.H','c++'):

+ -	print 'Did not find FLTK for the gui, exiting!'

+ +	print('Did not find FLTK for the gui, exiting!')

+  	Exit(1)

+  if not guiconf.CheckLibWithHeader('asound', 'alsa/asoundlib.h','c'):

+ -	print 'Did not find alsa, exiting!'

+ +	print('Did not find alsa, exiting!')

+  	Exit(1)

+  if not guiconf.CheckLibWithHeader('pthread', 'pthread.h','c'):

+ -	print 'Did not find pthread library, exiting!'

+ +	print('Did not find pthread library, exiting!')

+  	Exit(1)

+  guienv = guiconf.Finish()

+  guienv.Append(CPPFLAGS = ['-O3','-Wall','-fmessage-length=0'])

+  

+ -print"-                     2/2:compiling"

+ -print"-                     building the engine:"

+ +print("-                     2/2:compiling")

+ +print("-                     building the engine:")

+  

+  env.Program('minicomputerCPU','cpu/main.c');

+  

+ -print""

+ -print"-                     building the editor:"

+ +print("")

+ +print("-                     building the editor:")

+  

+  guienv.Program('minicomputer',['editor/main.cpp','editor/Memory.cpp','editor/syntheditor.cxx']);

+  

file modified
+9 -3
@@ -1,6 +1,6 @@ 

  Name:		minicomputer

  Version:	1.41

- Release:	27%{?dist}

+ Release:	28%{?dist}

  Summary:	Software Synthesizer

  License:	GPLv3+

  URL:		http://minicomputer.sourceforge.net/
@@ -10,6 +10,8 @@ 

  Patch0:		%{name}-linking.patch

  # GCC 4.7 fix

  Patch1:		%{name}-gcc47.patch

+ # Build with Python 3

+ Patch2:		%{name}-build-python3.patch

  

  BuildRequires:	gcc-c++

  BuildRequires:	alsa-lib-devel
@@ -17,7 +19,7 @@ 

  BuildRequires:	fltk-devel

  BuildRequires:	jack-audio-connection-kit-devel

  BuildRequires:	liblo-devel

- BuildRequires:	python2-scons

+ BuildRequires:	/usr/bin/scons

  

  Requires:	hicolor-icon-theme

  
@@ -32,6 +34,7 @@ 

  %setup -q -c -n MinicomputerV%{version}

  %patch0 -p1 -b .linking

  %patch1 -p1 -b .%{name}-gcc47.patch

+ %patch2 -p1 -b .%{name}-build-python3.patch

  

  # Fix optflags

  # SSE instruction set, which provides improved functionality, is only available in these archs:
@@ -43,7 +46,7 @@ 

  sed -i "s|\(^guienv.Append(CPPFLAGS =\).*|\1 ['%{optflags}'.split() ])|" SConstruct

  

  %build

- scons-2 %{?_smp_mflags}

+ scons %{?_smp_mflags}

  

  %install

  rm -rf %{buildroot}
@@ -67,6 +70,9 @@ 

  %{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm

  

  %changelog

+ * Fri Nov 01 2019 Petr Viktorin <pviktori@redhat.com> - 1.41-28

+ - Make the scons script compatible with Python 3

+ 

  * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.41-27

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

minicomputer is the last thing in fedora that needs scons-2. Could you switch to scons-3, so we can remove the Python 2 version?

This patch should make the build work with both scons-2 and scons-3. You might want to share it with upstream.

I would just BR "/usr/bin/scons" (or "scons") and use the "scons" command here. As you say in the description, it works with both pythons. (I realize that it might be a matter of style, so feel free to disagree.)

@pviktori What do you think about my suggestions

@verdurin What do you think?

Your suggestion sounds good to me.

rebased onto f341837

4 years ago

Pull-Request has been merged by verdurin

4 years ago

Thanks @pviktori for this, will rebuild with these fixes.