Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fltk1{3,4}: refactor #89929

Merged
merged 5 commits into from Jul 15, 2021
Merged

fltk1{3,4}: refactor #89929

merged 5 commits into from Jul 15, 2021

Conversation

OPNA2608
Copy link
Contributor

@OPNA2608 OPNA2608 commented Jun 9, 2020

Needs more comprehensive testing of packages depending on FLTK & which propagatedBuildInputs are actually needed. Feedback on whether to keep this attribute-per-option approach or switch to some dynamic attribute name -> CMake option conversion would be great.

Motivation for this change
  • FLTK versions are split into duplicate derivations
  • src uses an deprecated source location
  • build is missing alot of the available options
  • has no maintainer one could bother about this
Things done
  • Main derivation logic combined into 1 generic.nix with versions calling it, inspired by boost
  • moved to CMake
  • added all cmake options via attributes that versions can override as needed not all, only some useful ones
  • updated 1.4.x to master (no fixed release yet)
  • formatted with nixpkgs-fmt

CMake generates shared libraries with an extra suffix by default, patches -0001-
as based on upstream PR fltk/fltk#21 fix this.
CMake switch breaks fltk-config generation, partly addressed in -0002-
patches. Hard references to CC and CXX used at FLTK compile time remain,
needs more patching post-build.
Some of the propagatedBuildInputs might not be required, I tested some FLTK
applications with only xorgproto and encountered no problems.
PDF documentation errors, no clue how to fix (uses texlive and some more stuff)

See comment for in-between assessments.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Jul 9, 2020

Essentially paused while upstream is working on some structural improvements to their CMake config that'll obsolete the custom patches here. Still very much interested in getting this completed, still no clue about the TeX-related problems.

@SuperSandro2000
Copy link
Member

@OPNA2608 friendly ping

@OPNA2608
Copy link
Contributor Author

Still interested in this. I believe still waiting for upstream - see fltk/fltk#97, mostly regarding backports to 1.3. Prolly still no clue about the TeX docs, but I can try to fiddle more with it some time.

@ghost ghost mentioned this pull request Feb 10, 2021
10 tasks
@SuperSandro2000 SuperSandro2000 added the 2.status: wait-for-upstream Waiting for upstream fix (or their other action). label Apr 5, 2021
description = "A C++ cross-platform lightweight GUI library";
homepage = "https://www.fltk.org";
platforms = with platforms; linux ++ darwin;
license = licenses.lgpl2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgpl2Only or lpgpl2Plus?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified it for now, not sure if it makes sense to give them their own license instead? See https://www.fltk.org/COPYING.php.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment to see their site for exceptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already did that, the view here is just outdated.

# LGPL2 with static linking exception
# https://www.fltk.org/COPYING.php
license = licenses.lgpl2Only;

pkgs/development/libraries/fltk/generic.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/fltk/generic.nix Outdated Show resolved Hide resolved
@OPNA2608 OPNA2608 force-pushed the refactor-fltk branch 2 times, most recently from 932b20c to ea59abb Compare July 7, 2021 11:54
@OPNA2608 OPNA2608 removed the 2.status: wait-for-upstream Waiting for upstream fix (or their other action). label Jul 8, 2021
@ofborg ofborg bot requested review from abbradar and AndersonTorres July 8, 2021 12:30
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Jul 8, 2021

CMake generates shared libraries with an extra suffix by default, patches -0001-
as based on upstream PR fltk/fltk#21 fix this.

It seems that upstream fixed this.

CMake switch breaks fltk-config generation, partly addressed in -0002-
patches. Hard references to CC and CXX used at FLTK compile time remain,
needs more patching post-build.

We can do with just substituteInPlace, but currently the CC/CXX references remain. These are needed for fltk-config which doubles as a compile/link flags printer for using FLTK and compiler/linker wrapper:

Options to compile and link an application:
	[-g]              compile the program with debugging information
	[-Dname[=value]]  compile the program with the given define
	[--compile program.cxx]
        [--post program]  prepare the program for desktop use

Any suggestions for how to deal with that?

Some of the propagatedBuildInputs might not be required, I tested some FLTK
applications with only xorgproto and encountered no problems.

I changed the propagatedBuildInputs to include anything fltk-config tells depending projects to include/link against and removed some very liberally propagated dependencies:

  • xlibsWrapper is plain discouraged against
    # Avoid using this. It isn't really a wrapper anymore, but we keep the name.
    xlibsWrapper = callPackage ../development/libraries/xlibs-wrapper {
    
  • libXi is not required by the returned ldflags, projects that need it & any other X11 library propagated by xlibsWrapper should explicitly include them
  • freeglut was, afaict, included by accident based on the existence of a --use-glut flag. FLTK ships a custom GLUT-compatible framework - that's what this setting seems to refers to. Both --use-gl and --use-glut return the same ldflags to link against libfltk_gl, nothing more or less. (on Linux)

Still need to sort out Darwin stuff by testing it locally, haven't had the time yet.

PDF documentation errors, no clue how to fix (uses texlive and some more stuff)

I think I checked and it worked again, but generating both HTML & PDF documentations at the same time was broken now so I only set up the HTML one. I'll see if I can fix that & submit a patch upstream.


I added a fltk-minimal derivation just to test building FLTK with as few dependencies as possible. Not sure which one makes more sense - fltk & fltk-full or fltk-minimal and fltk - but I think having a light derivation for the Fast Light ToolKit prolly makes sense. 😄

@OPNA2608 OPNA2608 force-pushed the refactor-fltk branch 2 times, most recently from 57b5d70 to c0ab9d5 Compare July 9, 2021 06:25
@OPNA2608 OPNA2608 changed the base branch from master to staging July 9, 2021 08:47
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Jul 9, 2021

Targeting staging due to the amount of rebuilds.

@SuperSandro2000
Copy link
Member

You can target master with less than 500 rebuilds.

@OPNA2608 OPNA2608 changed the base branch from staging to master July 9, 2021 10:23
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Jul 9, 2021

Mmh, okay.

the symlink /nix/store/b639g83rkzjs3hygjvg245s8d395nqaq-fltk-1.3.6/bin/fluid is broken, it points to /nix/store/b639g83rkzjs3hygjvg245s8d395nqaq-fltk-1.3.6/bin/../Applications/fluid.app/Contents/MacOS/fluid (which is missing)
[…]
the symlink /nix/store/mc8vnrrnhfmj4q5gzvfixsq8vbslgfsk-fltk-1.3.6-bin/bin/CubeView is broken, it points to /nix/store/mc8vnrrnhfmj4q5gzvfixsq8vbslgfsk-fltk-1.3.6-bin/bin/../Applications/CubeView.app/Contents/MacOS/CubeView (which is missing)

I'll check what's going wrong there.

TODO #3 seems easily mvable to $out/Library/Frameworks/FLTK.framework. Still unsure about the other two.

afterstep is broken when reviewing locally (even when building on master), but works fine on OfBorg. I think this is due to a test -w /etc check in the Makefile that fails on NixOS but returns success on my Ubuntu machine, prompting the fatal use of ldconfig? I'll see if forcing that test to fail makes a difference.

Regarding cairo on Darwin, I'll check if it works on 1.4 and consider writing upstream about it if they have a clue. I think the HTML docs were broken too?


Result of nixpkgs-review pr 89929 run on x86_64-linux 1

8 packages marked as broken and skipped:
  • gnuradio3_7Packages.ais
  • gnuradio3_7Packages.gsm
  • gnuradio3_7Packages.limesdr
  • gnuradio3_7Packages.osmosdr
  • octave-jit
  • octavePackages.fem-fenics
  • octavePackages.vibes
  • octavePackages.vrml
1 package failed to build:
  • afterstep
133 packages built:
  • alsa-tools
  • bumblebee
  • crowbar
  • csound
  • csound-qt
  • cubicsdr
  • dillo
  • ensemble-chorus
  • eureka-editor
  • exrdisplay
  • faust2csound
  • fldigi
  • fllog
  • flmsg
  • flpsed
  • flrig
  • fltk (fltk13)
  • fltk-minimal
  • fltk14
  • fltrator
  • flwrap
  • gama
  • giac-with-xcas
  • giada
  • gmsh
  • gnss-sdr
  • gnuradio3_8Packages.ais
  • gnuradio3_8Packages.limesdr
  • gnuradio3_8Packages.osmosdr
  • gqrx
  • hyper-haskell
  • ja2-stracciatella
  • jwm-settings-manager
  • librsb
  • limesuite
  • liquidwar
  • lmms
  • minc_widgets
  • mup
  • new-session-manager
  • octave
  • octaveFull
  • octavePackages.arduino
  • octavePackages.audio
  • octavePackages.bim
  • octavePackages.bsltl
  • octavePackages.cgi
  • octavePackages.communications
  • octavePackages.control
  • octavePackages.data-smoothing
  • octavePackages.database
  • octavePackages.dataframe
  • octavePackages.dicom
  • octavePackages.divand
  • octavePackages.doctest
  • octavePackages.econometrics
  • octavePackages.financial
  • octavePackages.fits
  • octavePackages.fpl
  • octavePackages.fuzzy-logic-toolkit
  • octavePackages.ga
  • octavePackages.general
  • octavePackages.generate_html
  • octavePackages.geometry
  • octavePackages.gsl
  • octavePackages.image
  • octavePackages.image-acquisition
  • octavePackages.instrument-control
  • octavePackages.interval
  • octavePackages.io
  • octavePackages.level-set
  • octavePackages.linear-algebra
  • octavePackages.lssa
  • octavePackages.ltfat
  • octavePackages.mapping
  • octavePackages.matgeom
  • octavePackages.miscellaneous
  • octavePackages.msh
  • octavePackages.mvn
  • octavePackages.nan
  • octavePackages.ncarray
  • octavePackages.netcdf
  • octavePackages.nurbs
  • octavePackages.ocl
  • octavePackages.octclip
  • octavePackages.octproj
  • octavePackages.optics
  • octavePackages.optim
  • octavePackages.optiminterp
  • octavePackages.parallel
  • octavePackages.quaternion
  • octavePackages.queueing
  • octavePackages.signal
  • octavePackages.sockets
  • octavePackages.sparsersb
  • octavePackages.splines
  • octavePackages.statistics
  • octavePackages.stk
  • octavePackages.strings
  • octavePackages.struct
  • octavePackages.symbolic
  • octavePackages.tisean
  • octavePackages.tsa
  • octavePackages.video
  • octavePackages.windows
  • octavePackages.zeromq
  • openems
  • paulstretch
  • posterazor
  • pothos
  • python38Packages.fipy
  • python38Packages.python-csxcad
  • python38Packages.python-openems
  • python38Packages.soapysdr-with-plugins
  • python39Packages.fipy
  • python39Packages.python-csxcad
  • python39Packages.python-openems
  • python39Packages.soapysdr-with-plugins
  • qradiolink
  • rakarrack
  • rtl_433
  • sdrangel
  • seaview
  • soapysdr-with-plugins
  • solfege
  • tigervnc
  • urh
  • virtualgl
  • virtualglLib
  • welle-io
  • xautoclick
  • yoshimi
  • zynaddsubfx-fltk

FLTK doesn't dictate linking against libXi, so virtualgl should declare that
its own buildInputs.
Alternative would be to patch in the flags required for cairo, but this is
easier and more in-tune with the project.
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Jul 12, 2021

  • Fixed TODOs, hardcoded path to build-time $CC / $CXX in compile script remain. (Maybe adding the stdenv's compiler & fixing the paths to the runtime-correct one would be the best way? I'm open for suggestions.)
  • Fixed Cairo on Darwin with a workaround, filed & linked upstream bug CMake: Shared library + Cairo on macOS -> Missing symbols fltk/fltk#250.
  • Fixed afterstep on non-NixOS Linux.
  • Fixed docs generation.

Fingers crossed that I didn't miss anything? 🤞

@OPNA2608 OPNA2608 marked this pull request as ready for review July 12, 2021 10:30
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Jul 12, 2021

Result of nixpkgs-review pr 89929 run on x86_64-darwin 1

10 packages marked as broken and skipped:
  • crowbar
  • eureka-editor
  • giada
  • gnuradio3_7Packages.ais
  • gnuradio3_7Packages.osmosdr
  • gnuradio3_8Packages.ais
  • gnuradio3_8Packages.osmosdr
  • octave-jit
  • rtl_433
  • welle-io
2 packages failed to build:
  • librsb
  • octaveFull
7 packages built:
  • fltk (fltk13)
  • fltk-minimal (fltk13-minimal)
  • fltk14
  • fltk14-minimal
  • gama
  • minc_widgets
  • octave

Failures are either also present on Hydra (librsb, octaveFull) or due to at-first-glance unrelated issues? I'll take a closer look when I have more time. Ran again and got radically different results 🤷? Would appreciate another review on this platform.


Result of nixpkgs-review pr 89929 run on aarch64-linux 1

13 packages marked as broken and skipped:
  • giada
  • gnuradio3_7Packages.ais
  • gnuradio3_7Packages.gsm
  • gnuradio3_7Packages.limesdr
  • gnuradio3_7Packages.osmosdr
  • octave-jit
  • openems
  • python38Packages.fipy
  • python38Packages.python-csxcad
  • python38Packages.python-openems
  • python39Packages.fipy
  • python39Packages.python-csxcad
  • python39Packages.python-openems
1 package failed to build:
  • zynaddsubfx-fltk
55 packages built:
  • afterstep
  • alsa-tools
  • crowbar
  • csound
  • csound-qt
  • cubicsdr
  • dillo
  • ensemble-chorus
  • eureka-editor
  • exrdisplay
  • faust2csound
  • fldigi
  • fllog
  • flmsg
  • flpsed
  • flrig
  • fltk (fltk13)
  • fltk-minimal (fltk13-minimal)
  • fltk14
  • fltk14-minimal
  • fltrator
  • flwrap
  • gama
  • giac-with-xcas
  • gnss-sdr
  • gnuradio3_8Packages.ais
  • gnuradio3_8Packages.limesdr
  • gnuradio3_8Packages.osmosdr
  • gqrx
  • jwm-settings-manager
  • librsb
  • limesuite
  • liquidwar
  • minc_widgets
  • mup
  • octave
  • octavePackages.audio
  • paulstretch
  • posterazor
  • pothos
  • python38Packages.soapysdr-with-plugins
  • python39Packages.soapysdr-with-plugins
  • qradiolink
  • rakarrack
  • rtl_433
  • sdrangel
  • seaview
  • soapysdr-with-plugins
  • solfege
  • tigervnc
  • urh
  • virtualgl
  • virtualglLib
  • xautoclick
  • yoshimi

Will investigate failures. Seems to have been a temporary problem? zynaddsubfx-fltk also fails on Hydra so seems fine to me.


Result of nixpkgs-review pr 89929 run on x86_64-linux 1

8 packages marked as broken and skipped:
  • gnuradio3_7Packages.ais
  • gnuradio3_7Packages.gsm
  • gnuradio3_7Packages.limesdr
  • gnuradio3_7Packages.osmosdr
  • octave-jit
  • octavePackages.fem-fenics
  • octavePackages.vibes
  • octavePackages.vrml
135 packages built:
  • afterstep
  • alsa-tools
  • bumblebee
  • crowbar
  • csound
  • csound-qt
  • cubicsdr
  • dillo
  • ensemble-chorus
  • eureka-editor
  • exrdisplay
  • faust2csound
  • fldigi
  • fllog
  • flmsg
  • flpsed
  • flrig
  • fltk (fltk13)
  • fltk-minimal (fltk13-minimal)
  • fltk14
  • fltk14-minimal
  • fltrator
  • flwrap
  • gama
  • giac-with-xcas
  • giada
  • gmsh
  • gnss-sdr
  • gnuradio3_8Packages.ais
  • gnuradio3_8Packages.limesdr
  • gnuradio3_8Packages.osmosdr
  • gqrx
  • hyper-haskell
  • ja2-stracciatella
  • jwm-settings-manager
  • librsb
  • limesuite
  • liquidwar
  • lmms
  • minc_widgets
  • mup
  • new-session-manager
  • octave
  • octaveFull
  • octavePackages.arduino
  • octavePackages.audio
  • octavePackages.bim
  • octavePackages.bsltl
  • octavePackages.cgi
  • octavePackages.communications
  • octavePackages.control
  • octavePackages.data-smoothing
  • octavePackages.database
  • octavePackages.dataframe
  • octavePackages.dicom
  • octavePackages.divand
  • octavePackages.doctest
  • octavePackages.econometrics
  • octavePackages.financial
  • octavePackages.fits
  • octavePackages.fpl
  • octavePackages.fuzzy-logic-toolkit
  • octavePackages.ga
  • octavePackages.general
  • octavePackages.generate_html
  • octavePackages.geometry
  • octavePackages.gsl
  • octavePackages.image
  • octavePackages.image-acquisition
  • octavePackages.instrument-control
  • octavePackages.interval
  • octavePackages.io
  • octavePackages.level-set
  • octavePackages.linear-algebra
  • octavePackages.lssa
  • octavePackages.ltfat
  • octavePackages.mapping
  • octavePackages.matgeom
  • octavePackages.miscellaneous
  • octavePackages.msh
  • octavePackages.mvn
  • octavePackages.nan
  • octavePackages.ncarray
  • octavePackages.netcdf
  • octavePackages.nurbs
  • octavePackages.ocl
  • octavePackages.octclip
  • octavePackages.octproj
  • octavePackages.optics
  • octavePackages.optim
  • octavePackages.optiminterp
  • octavePackages.parallel
  • octavePackages.quaternion
  • octavePackages.queueing
  • octavePackages.signal
  • octavePackages.sockets
  • octavePackages.sparsersb
  • octavePackages.splines
  • octavePackages.statistics
  • octavePackages.stk
  • octavePackages.strings
  • octavePackages.struct
  • octavePackages.symbolic
  • octavePackages.tisean
  • octavePackages.tsa
  • octavePackages.video
  • octavePackages.windows
  • octavePackages.zeromq
  • openems
  • paulstretch
  • posterazor
  • pothos
  • python38Packages.fipy
  • python38Packages.python-csxcad
  • python38Packages.python-openems
  • python38Packages.soapysdr-with-plugins
  • python39Packages.fipy
  • python39Packages.python-csxcad
  • python39Packages.python-openems
  • python39Packages.soapysdr-with-plugins
  • qradiolink
  • rakarrack
  • rtl_433
  • sdrangel
  • seaview
  • soapysdr-with-plugins
  • solfege
  • tigervnc
  • urh
  • virtualgl
  • virtualglLib
  • welle-io
  • xautoclick
  • yoshimi
  • zynaddsubfx-fltk

@SuperSandro2000 SuperSandro2000 merged commit 60dd8dd into NixOS:master Jul 15, 2021
@OPNA2608 OPNA2608 mentioned this pull request Jul 15, 2021
@OPNA2608 OPNA2608 deleted the refactor-fltk branch September 27, 2022 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants