nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit c1aa64d01aa308933ad4df1e3c46bbd97a4138c5
parent 5507e37183ee698f8b130062726d49f4141bedd8
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Tue, 21 Apr 2020 19:57:17 +0300

Fix builds on darwin

Diffstat:
Mpkgs/applications/gpxlab/default.nix | 12++++++++++--
Mpkgs/applications/gpxsee/default.nix | 12++++++++++--
Mpkgs/applications/openorienteering-mapper/default.nix | 15++++++++-------
Mpkgs/applications/redict/default.nix | 10++++++++--
Mpkgs/build-support/fetchgdrive/default.nix | 10+++++++---
Mpkgs/default.nix | 2+-
Mpkgs/tools/cfiles/default.nix | 3++-
Mpkgs/tools/dict/stardict-tools/default.nix | 9++++++---
Mpkgs/tools/geo/gimgtools/default.nix | 9++++++++-
Mpkgs/tools/geo/ocad2img/default.nix | 2+-
Mpkgs/tools/geo/ocad2mp/default.nix | 21++++++++++++++++++---
11 files changed, 79 insertions(+), 26 deletions(-)

diff --git a/pkgs/applications/gpxlab/default.nix b/pkgs/applications/gpxlab/default.nix @@ -1,5 +1,13 @@ -{ stdenv, mkDerivation, lib, qmake, qtbase, qttools, qttranslations, sources -, withI18n ? false }: +{ stdenv +, mkDerivation +, lib +, qmake +, qtbase +, qttools +, qttranslations +, sources +, withI18n ? true +}: mkDerivation rec { pname = "gpxlab"; diff --git a/pkgs/applications/gpxsee/default.nix b/pkgs/applications/gpxsee/default.nix @@ -1,5 +1,13 @@ -{ stdenv, mkDerivation, lib, qmake, qtbase, qttools, qttranslations, sources -, withI18n ? true }: +{ stdenv +, mkDerivation +, lib +, qmake +, qtbase +, qttools +, qttranslations +, sources +, withI18n ? true +}: mkDerivation rec { pname = "gpxsee"; diff --git a/pkgs/applications/openorienteering-mapper/default.nix b/pkgs/applications/openorienteering-mapper/default.nix @@ -1,4 +1,5 @@ { stdenv +, lib , gdal , cmake , ninja @@ -18,7 +19,7 @@ stdenv.mkDerivation rec { pname = "OpenOrienteering-Mapper"; - version = stdenv.lib.substring 0 7 src.rev; + version = lib.substring 0 7 src.rev; src = sources.mapper; buildInputs = [ @@ -42,7 +43,7 @@ stdenv.mkDerivation rec { "-DLICENSING_PROVIDER:BOOL=OFF" "-DMapper_MANUAL_QTHELP:BOOL=OFF" ] ++ ( - stdenv.lib.optionals stdenv.isDarwin [ + lib.optionals stdenv.isDarwin [ # Usually enabled on Darwin "-DCMAKE_FIND_FRAMEWORK=never" # FindGDAL is broken and always finds /Library/Framework unless this is @@ -58,15 +59,15 @@ stdenv.mkDerivation rec { ] ); - postInstall = stdenv.lib.optionalString stdenv.isDarwin '' + postInstall = lib.optionalString stdenv.isDarwin '' + mkdir -p $out/Applications + mv $out/Mapper.app $out/Applications # Fixes "This application failed to start because it could not find or load the Qt # platform plugin "cocoa"." - wrapQtApp $out/Mapper.app/Contents/MacOS/Mapper - mkdir -p $out/bin - ln -s $out/Mapper.app/Contents/MacOS/Mapper $out/bin/mapper + wrapQtApp $out/Applications/Mapper.app/Contents/MacOS/Mapper ''; - meta = with stdenv.lib; { + meta = with lib; { inherit (src) description homepage; license = licenses.gpl3; maintainers = with maintainers; [ sikmir ]; diff --git a/pkgs/applications/redict/default.nix b/pkgs/applications/redict/default.nix @@ -1,4 +1,5 @@ { mkDerivation +, stdenv , lib , pkgconfig , qmake @@ -21,7 +22,12 @@ mkDerivation rec { nativeBuildInputs = [ qmake pkgconfig ] ++ (lib.optional withI18n qttools); buildInputs = - [ qtbase qtmultimedia qtsvg qtx11extras libX11 libXext libXtst ]; + [ qtbase qtmultimedia qtsvg ] ++ (lib.optionals stdenv.isLinux [ qtx11extras libX11 libXext libXtst ]); + + postPatch = '' + substituteInPlace redict.pro \ + --replace "unix " "unix:!mac " + ''; preConfigure = lib.optionalString withI18n '' lupdate redict.pro @@ -40,6 +46,6 @@ mkDerivation rec { inherit (src) description homepage; license = licenses.gpl3; maintainers = with maintainers; [ sikmir ]; - platforms = platforms.linux; + platforms = with platforms; linux ++ darwin; }; } diff --git a/pkgs/build-support/fetchgdrive/default.nix b/pkgs/build-support/fetchgdrive/default.nix @@ -2,6 +2,10 @@ { id, ... } @ args: -(fetchurl ({ - url = "https://drive.google.com/uc?export=download&id=${id}"; -} // removeAttrs args [ "id" ])) +( + fetchurl ( + { + url = "https://drive.google.com/uc?export=download&id=${id}"; + } // removeAttrs args [ "id" ] + ) +) diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -25,7 +25,7 @@ lib.makeScope newScope ( ### BUILD SUPPORT - fetchgdrive = callPackage ./build-support/fetchgdrive { }; + fetchgdrive = callPackage ./build-support/fetchgdrive {}; ### DATA diff --git a/pkgs/tools/cfiles/default.nix b/pkgs/tools/cfiles/default.nix @@ -10,6 +10,7 @@ stdenv.mkDerivation rec { prePatch = '' substituteInPlace Makefile \ + --replace "CC = gcc" "" \ --replace "prefix = usr" "prefix=$out" substituteInPlace scripts/clearimg \ --replace "/usr/lib/w3m/w3mimgdisplay" "${w3m}/bin/w3mimgdisplay" @@ -23,6 +24,6 @@ stdenv.mkDerivation rec { inherit (src) description homepage; license = licenses.mit; maintainers = with maintainers; [ sikmir ]; - platforms = platforms.unix; + platforms = with platforms; linux ++ darwin; }; } diff --git a/pkgs/tools/dict/stardict-tools/default.nix b/pkgs/tools/dict/stardict-tools/default.nix @@ -28,7 +28,10 @@ stdenv.mkDerivation rec { pcre ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=format-security" ]; + NIX_CFLAGS_COMPILE = [ + "-std=c++03" + "-Wno-error=format-security" + ]; postPatch = '' substituteInPlace tools/src/wikipediaImage.cpp \ @@ -37,7 +40,7 @@ stdenv.mkDerivation rec { --replace "noinst_PROGRAMS =" "bin_PROGRAMS =" ''; - preConfigure = ''./autogen.sh''; + preConfigure = "./autogen.sh"; configureFlags = [ "--disable-dict" ]; postInstall = '' @@ -52,6 +55,6 @@ stdenv.mkDerivation rec { inherit (src) description homepage; license = licenses.gpl3; maintainers = with maintainers; [ sikmir ]; - platforms = platforms.linux; + platforms = with platforms; linux ++ darwin; }; } diff --git a/pkgs/tools/geo/gimgtools/default.nix b/pkgs/tools/geo/gimgtools/default.nix @@ -1,10 +1,17 @@ -{ stdenv, sources }: +{ stdenv, sources, libiconv }: stdenv.mkDerivation rec { pname = "gimgtools"; version = stdenv.lib.substring 0 7 src.rev; src = sources.gimgtools; + buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv; + + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile \ + --replace "CC = gcc" "" + ''; + installPhase = '' for tool in gimginfo gimgfixcmd gimgxor gimgunlock gimgch gimgextract cmdc; do install -Dm755 $tool $out/bin/$tool diff --git a/pkgs/tools/geo/ocad2img/default.nix b/pkgs/tools/geo/ocad2img/default.nix @@ -43,6 +43,6 @@ buildPerlPackage rec { homepage = "http://news.worldofo.com/2009/10/11/howto-convert-any-orienteering-map-to-a-garmin-map/"; license = licenses.gpl3; maintainers = with maintainers; [ sikmir ]; - platforms = platforms.unix; + platforms = platforms.linux; }; } diff --git a/pkgs/tools/geo/ocad2mp/default.nix b/pkgs/tools/geo/ocad2mp/default.nix @@ -10,9 +10,24 @@ stdenv.mkDerivation rec { sha256 = "1700apfsjd27q9jsvvr94mk7rd0x24ib3bkn4y8hak0zvknib563"; }; - NIX_CFLAGS_COMPILE = "-std=c++03 -include stddef.h -Wno-error=format-security"; + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile.gcc \ + --replace "CXX=g++" "" \ + --replace "LINK=g++" "LINK=$CXX" \ + --replace "-lgcc" "" + ''; + + NIX_CFLAGS_COMPILE = [ + "-std=c++03" + "-include stddef.h" + "-Wno-error=format-security" + ]; - makeFlags = [ "-f" "Makefile.gcc" "CFG=Release" "TARGET_ARCH_BITS=64" ]; + makeFlags = [ + "-f Makefile.gcc" + "CFG=Release" + "TARGET_ARCH_BITS=64" + ]; installPhase = '' install -Dm755 Release/ocad2mp -t "$out/bin" @@ -24,6 +39,6 @@ stdenv.mkDerivation rec { homepage = "https://sourceforge.net/projects/ocad2mp/"; license = licenses.gpl2; maintainers = with maintainers; [ sikmir ]; - platforms = platforms.linux; + platforms = with platforms; linux ++ darwin; }; }