commit 00a640d11804ee7bbada86750c2d509240eeac93
parent cf7766cabfe40b91af1ac43870aaac1c22c45fbd
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Thu, 3 Dec 2020 22:30:51 +0300
sasplanet: fix running
Diffstat:
3 files changed, 34 insertions(+), 37 deletions(-)
diff --git a/pkgs/applications/gis/sasplanet/bin.nix b/pkgs/applications/gis/sasplanet/bin.nix
@@ -0,0 +1,33 @@
+{ stdenv, unzip, wine, makeWrapper, sources }:
+let
+ year = stdenv.lib.substring 0 2 sources.sasplanet.version;
+ month = stdenv.lib.substring 2 2 sources.sasplanet.version;
+ day = stdenv.lib.substring 4 2 sources.sasplanet.version;
+in
+stdenv.mkDerivation {
+ pname = "sasplanet-bin";
+ version = "20${year}-${month}-${day}";
+
+ src = sources.sasplanet;
+
+ nativeBuildInputs = [ unzip makeWrapper ];
+
+ installPhase = ''
+ mkdir -p $out/opt/sasplanet
+ cp -r . $out/opt/sasplanet
+
+ makeWrapper ${wine}/bin/wine $out/bin/sasplanet \
+ --run "[ -d \$HOME/.sasplanet ] || { cp -r $out/opt/sasplanet \$HOME/.sasplanet && chmod -R +w \$HOME/.sasplanet; }" \
+ --add-flags "\$HOME/.sasplanet/SASPlanet.exe"
+ '';
+
+ preferLocalBuild = true;
+
+ meta = with stdenv.lib; {
+ inherit (sources.sasplanet) description homepage;
+ license = licenses.gpl3Plus;
+ maintainers = [ maintainers.sikmir ];
+ platforms = platforms.all;
+ skip.ci = true;
+ };
+}
diff --git a/pkgs/applications/gis/sasplanet/default.nix b/pkgs/applications/gis/sasplanet/default.nix
@@ -1,36 +0,0 @@
-{ stdenv, unzip, wine, writers, sources }:
-let
- year = stdenv.lib.substring 0 2 sources.sasplanet.version;
- month = stdenv.lib.substring 2 2 sources.sasplanet.version;
- day = stdenv.lib.substring 4 2 sources.sasplanet.version;
-
- runScript = writers.writeBash "sasplanet" ''
- ${wine}/bin/wine @out@/SAS.Planet.Release.${sources.sasplanet.version}/SASPlanet.exe
- '';
-in
-stdenv.mkDerivation {
- pname = "sasplanet";
- version = "20${year}-${month}-${day}";
-
- src = sources.sasplanet;
-
- dontUnpack = true;
-
- installPhase = ''
- install -dm755 $out/bin
- substitute ${runScript} $out/bin/sasplanet --subst-var out
- chmod +x $out/bin/sasplanet
-
- ${unzip}/bin/unzip $src -d $out
- '';
-
- preferLocalBuild = true;
-
- meta = with stdenv.lib; {
- inherit (sources.sasplanet) description homepage;
- license = licenses.gpl3;
- maintainers = [ maintainers.sikmir ];
- platforms = platforms.all;
- skip.ci = true;
- };
-}
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -43,7 +43,7 @@ lib.makeScope newScope (
redict = libsForQt5.callPackage ./applications/redict {
inherit sources;
};
- sasplanet = callPackage ./applications/gis/sasplanet { };
+ sasplanet-bin = callPackage ./applications/gis/sasplanet/bin.nix { };
tdh = callPackage ./applications/gis/tdh { };
visualgps = libsForQt5.callPackage ./applications/visualgps { };
wireguard-statusbar-bin = callPackage ./applications/wireguard-statusbar { };