biscuit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

default.nix (1835B)


      1 { stdenv
      2 , pkg-config
      3 , buildPackages
      4 , callPackage
      5 , cairo
      6 , clutter
      7 , fetchFromGitHub
      8 , fetchurl
      9 , gobject-introspection
     10 , gtk3
     11 , lib
     12 , lua53Packages
     13 , lua5_3
     14 , makeDesktopItem
     15 , wrapGAppsHook3
     16 , writeText
     17 , glib-networking
     18 , copyDesktopItems
     19 }:
     20 let
     21   luaPackages = lua53Packages;
     22   fennel = luaPackages.fennel;
     23   lgi = luaPackages.buildLuaPackage {
     24     pname = "lgi";
     25     version = "0.9.2-2";
     26     buildInputs = [ gobject-introspection wrapGAppsHook3 copyDesktopItems ];
     27     nativeBuildInputs = [ pkg-config ];
     28 
     29     src = fetchFromGitHub {
     30       owner = "lgi-devs";
     31       repo = "lgi";
     32       rev = "a412921fad445bcfc05a21148722a92ecb93ad06";
     33       hash = "sha256-kZBpH5gcaCNU134Wn6JXAkFELzmiphc1PeCtmN9cagc=";
     34     };
     35   };
     36   rxi-json = callPackage ../rxi-json { lua = lua5_3; };
     37   gpxparse = callPackage ../gpxparse { lua = lua5_3; };
     38 
     39   lua = lua5_3.withPackages (ps: with ps; [
     40     lgi
     41     luafilesystem
     42     luaposix
     43     readline
     44     http
     45     rxi-json
     46     gpxparse
     47     penlight
     48     luaexpat
     49   ]);
     50   pname = "maps";
     51 in stdenv.mkDerivation {
     52   inherit pname;
     53   version = "0.1";
     54   src =./.;
     55 
     56   buildInputs = [
     57     lua
     58     gtk3.dev
     59     cairo.dev
     60     gobject-introspection
     61     glib-networking
     62   ];
     63   nativeBuildInputs = [
     64     gobject-introspection
     65     fennel
     66     wrapGAppsHook3
     67     copyDesktopItems
     68   ];
     69 
     70   GIO_EXTRA_MODULES = [ "${glib-networking.out}/lib/gio/modules" ];
     71   CAIRO_TRACE_SO = "${cairo.out}/lib/cairo/libcairo-trace.so";
     72 
     73   makeFlags = [ "PREFIX=${placeholder "out"}" "NAME=${pname}" ];
     74 
     75   postInstall = ''
     76     install -Dm644 ${./icon.svg} $out/share/icons/hicolor/scalable/apps/${pname}.svg
     77   '';
     78 
     79   desktopItems = [
     80     (makeDesktopItem {
     81       name = pname;
     82       desktopName = "Maps";
     83       exec = pname;
     84       type = "Application";
     85       icon = pname;
     86     })
     87   ];
     88 
     89   passthru = {
     90     inherit lua luaPackages;
     91   };
     92 
     93 }