default.nix (1136B)
1 { stdenv 2 , mkDerivation 3 , lib 4 , qmake 5 , qtbase 6 , qttools 7 , qttranslations 8 , sources 9 , substituteAll 10 , withI18n ? true 11 }: 12 13 mkDerivation rec { 14 pname = "gpxlab-unstable"; 15 version = lib.substring 0 10 sources.gpxlab.date; 16 17 src = sources.gpxlab; 18 19 patches = (substituteAll { 20 # See https://github.com/NixOS/nixpkgs/issues/86054 21 src = ./fix-qttranslations-path.patch; 22 inherit qttranslations; 23 }); 24 25 postPatch = '' 26 sed -i "s/\(VERSION = \).*/\1${version}/" GPXLab/GPXLab.pro 27 ''; 28 29 nativeBuildInputs = [ qmake ] ++ (lib.optional withI18n qttools); 30 31 preConfigure = lib.optionalString withI18n '' 32 lrelease GPXLab/locale/*.ts 33 ''; 34 35 postInstall = lib.optionalString stdenv.isDarwin '' 36 mkdir -p $out/Applications 37 mv GPXLab/GPXLab.app $out/Applications 38 wrapQtApp $out/Applications/GPXLab.app/Contents/MacOS/GPXLab 39 mkdir -p $out/bin 40 ln -s $out/Applications/GPXLab.app/Contents/MacOS/GPXLab $out/bin/gpxlab 41 ''; 42 43 meta = with lib; { 44 inherit (sources.gpxlab) description homepage; 45 license = licenses.gpl3; 46 maintainers = [ maintainers.sikmir ]; 47 platforms = platforms.unix; 48 }; 49 }