nur-packages

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

default.nix (2060B)


      1 { lib
      2 , stdenv
      3 , fetchFromGitHub
      4 , python2Packages
      5 , postgresql
      6 , openssl
      7 }:
      8 let
      9   psycopg2 = python2Packages.buildPythonPackage rec {
     10     pname = "psycopg2";
     11     version = "2.8.6";
     12 
     13     src = python2Packages.fetchPypi {
     14       inherit pname version;
     15       hash = "sha256-+yP2xxEHw3/WZ8tOo2Pd65NrNIu9ZEknjrksGJaZ9UM=";
     16     };
     17 
     18     buildInputs = lib.optional stdenv.isDarwin openssl;
     19     nativeBuildInputs = [ postgresql ];
     20 
     21     doCheck = false;
     22 
     23     meta = with lib; {
     24       description = "PostgreSQL database adapter for the Python programming language";
     25       license = with licenses; [ gpl2 zpl20 ];
     26     };
     27   };
     28 in
     29 python2Packages.buildPythonApplication rec {
     30   pname = "tracks_storage_server";
     31   version = "2018-03-24";
     32 
     33   src = fetchFromGitHub {
     34     owner = "wladich";
     35     repo = "tracks_storage_server";
     36     rev = "58ecde50bdc41e8b71590f62b7019d641e69da88";
     37     hash = "sha256-rHh3iuhQhhVzGAfyNXfhBB41PzQF7rSmOMtYM10bFkU=";
     38   };
     39 
     40   dontUseSetuptoolsBuild = true;
     41   dontUseSetuptoolsCheck = true;
     42 
     43   installPhase =
     44     let
     45       pythonEnv = python2Packages.python.withPackages (p: with p; [
     46         msgpack
     47         (protobuf.overrideAttrs (old: {
     48           dontUsePythonImportsCheck = true;
     49         }))
     50         psycopg2
     51       ]);
     52     in
     53     ''
     54       site_packages=$out/lib/${python2Packages.python.libPrefix}/site-packages
     55       mkdir -p $site_packages
     56       cp *.py *.sql $site_packages
     57 
     58       substitute config.py.example $site_packages/config.py \
     59         --replace "'password" "#'password"
     60 
     61       makeWrapper ${pythonEnv.interpreter} $out/bin/tracks_storage_server \
     62         --add-flags "$site_packages/server.py"
     63       makeWrapper ${pythonEnv.interpreter} $out/bin/init_db \
     64         --add-flags "$site_packages/init_db.py"
     65     '';
     66 
     67   passthru.psycopg2 = psycopg2;
     68 
     69   meta = with lib; {
     70     description = "Tracks storage server";
     71     inherit (src.meta) homepage;
     72     license = licenses.free;
     73     maintainers = with maintainers; [ sikmir ];
     74     broken = true; # python2Packages.protobuf (error: mox-0.7.8 not supported for interpreter python2.7)
     75   };
     76 }