sourcehut: init

builds-sr-ht: init at 0.45.13
dispatch-sr-ht: init at 0.11.0
git-sr-ht: init at 0.32.3
hg-sr-ht: init at 0.13.0
lists-sr-ht: init at 0.36.3
man-sr-ht: init at 0.12.4
meta-sr-ht: init at 0.34.3
paste-sr-ht: init at 0.5.1
todo-sr-ht: init at 0.46.8

+694
+60
pkgs/applications/version-management/sourcehut/builds.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , buildGoModule 4 + , srht, redis, celery, pyyaml, markdown }: 5 + 6 + let 7 + version = "0.45.13"; 8 + 9 + buildWorker = src: buildGoModule { 10 + inherit src version; 11 + pname = "builds-sr-ht-worker"; 12 + goPackagePath = "git.sr.ht/~sircmpwn/builds.sr.ht/worker"; 13 + 14 + modSha256 = "1jm259ncw8dgqp0fqbjn30c4y3v3vwqj41gfh99jx30bwlmpgfax"; 15 + }; 16 + in buildPythonPackage rec { 17 + inherit version; 18 + pname = "buildsrht"; 19 + 20 + src = fetchgit { 21 + url = "https://git.sr.ht/~sircmpwn/builds.sr.ht"; 22 + rev = version; 23 + sha256 = "002pcj2a98gbmv77a10449w1q6iqhqjz4fim8hm4qm7vn6bwp0hz"; 24 + }; 25 + 26 + patches = [ 27 + ./use-srht-path.patch 28 + ]; 29 + 30 + nativeBuildInputs = srht.nativeBuildInputs; 31 + 32 + propagatedBuildInputs = [ 33 + srht 34 + redis 35 + celery 36 + pyyaml 37 + markdown 38 + ]; 39 + 40 + preBuild = '' 41 + export PKGVER=${version} 42 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 43 + ''; 44 + 45 + postInstall = '' 46 + mkdir -p $out/lib 47 + mkdir -p $out/bin/builds.sr.ht 48 + 49 + cp -r images $out/lib 50 + cp contrib/submit_image_build $out/bin/builds.sr.ht 51 + cp ${buildWorker "${src}/worker"}/bin/worker $out/bin/builds.sr.ht-worker 52 + ''; 53 + 54 + meta = with stdenv.lib; { 55 + homepage = https://git.sr.ht/~sircmpwn/builds.sr.ht; 56 + description = "Continuous integration service for the sr.ht network"; 57 + license = licenses.agpl3; 58 + maintainers = with maintainers; [ eadwu ]; 59 + }; 60 + }
+80
pkgs/applications/version-management/sourcehut/core.nix
··· 1 + { stdenv, fetchgit, fetchNodeModules, buildPythonPackage 2 + , pgpy, flask, bleach, misaka, humanize, markdown, psycopg2, pygments, requests 3 + , sqlalchemy, flask_login, beautifulsoup4, sqlalchemy-utils, celery, alembic 4 + , sassc, nodejs-11_x 5 + , writeText }: 6 + 7 + buildPythonPackage rec { 8 + pname = "srht"; 9 + version = "0.52.13"; 10 + 11 + src = fetchgit { 12 + url = "https://git.sr.ht/~sircmpwn/core.sr.ht"; 13 + rev = version; 14 + sha256 = "0i7gd2rkq4y4lffxsgb3mql9ddmk3vqckan29w266imrqs6p8c0z"; 15 + }; 16 + 17 + node_modules = fetchNodeModules { 18 + src = "${src}/srht"; 19 + nodejs = nodejs-11_x; 20 + sha256 = "0axl50swhcw8llq8z2icwr4nkr5qsw2riih0a040f9wx4xiw4p6p"; 21 + }; 22 + 23 + patches = [ 24 + ./disable-npm-install.patch 25 + ]; 26 + 27 + nativeBuildInputs = [ 28 + sassc 29 + nodejs-11_x 30 + ]; 31 + 32 + propagatedBuildInputs = [ 33 + pgpy 34 + flask 35 + bleach 36 + misaka 37 + humanize 38 + markdown 39 + psycopg2 40 + pygments 41 + requests 42 + sqlalchemy 43 + flask_login 44 + beautifulsoup4 45 + sqlalchemy-utils 46 + 47 + # Unofficial runtime dependencies? 48 + celery 49 + alembic 50 + ]; 51 + 52 + PKGVER = version; 53 + 54 + preBuild = '' 55 + cp -r ${node_modules} srht/node_modules 56 + ''; 57 + 58 + # No actual? tests but seems like it needs this anyway 59 + preCheck = let 60 + config = writeText "config.ini" '' 61 + [webhooks] 62 + private-key=K6JupPpnr0HnBjelKTQUSm3Ro9SgzEA2T2Zv472OvzI= 63 + 64 + [meta.sr.ht] 65 + origin=http://meta.sr.ht.local 66 + ''; 67 + in '' 68 + # Validation needs config option(s) 69 + # webhooks <- ( private-key ) 70 + # meta.sr.ht <- ( origin ) 71 + cp ${config} config.ini 72 + ''; 73 + 74 + meta = with stdenv.lib; { 75 + homepage = https://git.sr.ht/~sircmpwn/srht; 76 + description = "Core modules for sr.ht"; 77 + license = licenses.bsd3; 78 + maintainers = with maintainers; [ eadwu ]; 79 + }; 80 + }
+49
pkgs/applications/version-management/sourcehut/default.nix
··· 1 + { python37, openssl_1_1 2 + , callPackage }: 3 + 4 + # To expose the *srht modules, they have to be a python module so we use `buildPythonModule` 5 + # Then we expose them through all-packages.nix as an application through `toPythonApplication` 6 + # https://github.com/NixOS/nixpkgs/pull/54425#discussion_r250688781 7 + 8 + let 9 + fetchNodeModules = callPackage ../../networking/instant-messengers/rambox/fetchNodeModules.nix { }; 10 + 11 + python = python37.override { 12 + packageOverrides = self: super: { 13 + srht = self.callPackage ./core.nix { inherit fetchNodeModules; }; 14 + 15 + buildsrht = self.callPackage ./builds.nix { }; 16 + dispatchsrht = self.callPackage ./dispatch.nix { }; 17 + gitsrht = self.callPackage ./git.nix { }; 18 + hgsrht = self.callPackage ./hg.nix { }; 19 + listssrht = self.callPackage ./lists.nix { }; 20 + mansrht = self.callPackage ./man.nix { }; 21 + metasrht = self.callPackage ./meta.nix { }; 22 + pastesrht = self.callPackage ./paste.nix { }; 23 + todosrht = self.callPackage ./todo.nix { }; 24 + 25 + scmsrht = self.callPackage ./scm.nix { }; 26 + 27 + # OVERRIDES 28 + 29 + cryptography = super.cryptography.override { 30 + openssl = openssl_1_1; 31 + }; 32 + 33 + pyopenssl = super.pyopenssl.override { 34 + openssl = openssl_1_1; 35 + }; 36 + }; 37 + }; 38 + in with python.pkgs; { 39 + inherit python; 40 + buildsrht = toPythonApplication buildsrht; 41 + dispatchsrht = toPythonApplication dispatchsrht; 42 + gitsrht = toPythonApplication gitsrht; 43 + hgsrht = toPythonApplication hgsrht; 44 + listssrht = toPythonApplication listssrht; 45 + mansrht = toPythonApplication mansrht; 46 + metasrht = toPythonApplication metasrht; 47 + pastesrht = toPythonApplication pastesrht; 48 + todosrht = toPythonApplication todosrht; 49 + }
+14
pkgs/applications/version-management/sourcehut/disable-npm-install.patch
··· 1 + diff --git a/setup.py b/setup.py 2 + index d63bac8..e1d0c35 100755 3 + --- a/setup.py 4 + +++ b/setup.py 5 + @@ -5,9 +5,6 @@ import glob 6 + import os 7 + import sys 8 + 9 + -if subprocess.call(["npm", "i"], cwd="srht") != 0: 10 + - sys.exit(1) 11 + - 12 + ver = os.environ.get("PKGVER") or subprocess.run(['git', 'describe', '--tags'], 13 + stdout=subprocess.PIPE).stdout.decode().strip() 14 +
+39
pkgs/applications/version-management/sourcehut/dispatch.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , srht, pyyaml, PyGithub, cryptography }: 4 + 5 + buildPythonPackage rec { 6 + pname = "dispatchsrht"; 7 + version = "0.11.0"; 8 + 9 + src = fetchgit { 10 + url = "https://git.sr.ht/~sircmpwn/dispatch.sr.ht"; 11 + rev = version; 12 + sha256 = "1kahl2gy5a5li79djwkzkglkw2s7pl4d29bzqp8c53r0xvx4sqkz"; 13 + }; 14 + 15 + patches = [ 16 + ./use-srht-path.patch 17 + ]; 18 + 19 + nativeBuildInputs = srht.nativeBuildInputs; 20 + 21 + propagatedBuildInputs = [ 22 + srht 23 + pyyaml 24 + PyGithub 25 + cryptography 26 + ]; 27 + 28 + preBuild = '' 29 + export PKGVER=${version} 30 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 31 + ''; 32 + 33 + meta = with stdenv.lib; { 34 + homepage = https://dispatch.sr.ht/~sircmpwn/dispatch.sr.ht; 35 + description = "Task dispatcher and service integration tool for the sr.ht network"; 36 + license = licenses.agpl3; 37 + maintainers = with maintainers; [ eadwu ]; 38 + }; 39 + }
+55
pkgs/applications/version-management/sourcehut/git.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , buildGoModule 4 + , srht, pygit2, scmsrht }: 5 + 6 + let 7 + version = "0.32.3"; 8 + 9 + buildDispatcher = src: buildGoModule { 10 + inherit src version; 11 + pname = "git-sr-ht-dispatcher"; 12 + goPackagePath = "git.sr.ht/~sircmpwn/git.sr.ht/gitsrht-dispatch"; 13 + 14 + modSha256 = "1lmgmlin460g09dph2hw6yz25d4agqwjhrjv0qqsis7df9qpf3i1"; 15 + }; 16 + in buildPythonPackage rec { 17 + inherit version; 18 + pname = "gitsrht"; 19 + 20 + src = fetchgit { 21 + url = "https://git.sr.ht/~sircmpwn/git.sr.ht"; 22 + rev = version; 23 + sha256 = "0grycmblhm9dnhcf1kcmn6bclgb9znahk2026dan58m9j9pja5vw"; 24 + }; 25 + 26 + patches = [ 27 + ./use-srht-path.patch 28 + ]; 29 + 30 + nativeBuildInputs = srht.nativeBuildInputs; 31 + 32 + propagatedBuildInputs = [ 33 + srht 34 + pygit2 35 + scmsrht 36 + ]; 37 + 38 + preBuild = '' 39 + export PKGVER=${version} 40 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 41 + ''; 42 + 43 + # TODO: Remove redundant mkdir? 44 + postInstall = '' 45 + mkdir -p $out/bin 46 + cp ${buildDispatcher "${src}/gitsrht-dispatch"}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch 47 + ''; 48 + 49 + meta = with stdenv.lib; { 50 + homepage = https://git.sr.ht/~sircmpwn/git.sr.ht; 51 + description = "Git repository hosting service for the sr.ht network"; 52 + license = licenses.agpl3; 53 + maintainers = with maintainers; [ eadwu ]; 54 + }; 55 + }
+39
pkgs/applications/version-management/sourcehut/hg.nix
··· 1 + { stdenv, fetchhg, buildPythonPackage 2 + , python 3 + , srht, hglib, scmsrht, unidiff }: 4 + 5 + buildPythonPackage rec { 6 + pname = "hgsrht"; 7 + version = "0.13.0"; 8 + 9 + src = fetchhg { 10 + url = "https://hg.sr.ht/~sircmpwn/hg.sr.ht"; 11 + rev = version; 12 + sha256 = "0qkknvja0pyk69fvzqafj3x8hi5miw22nmksvifbrjcqph8jknqg"; 13 + }; 14 + 15 + patches = [ 16 + ./use-srht-path.patch 17 + ]; 18 + 19 + nativeBuildInputs = srht.nativeBuildInputs; 20 + 21 + propagatedBuildInputs = [ 22 + srht 23 + hglib 24 + scmsrht 25 + unidiff 26 + ]; 27 + 28 + preBuild = '' 29 + export PKGVER=${version} 30 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 31 + ''; 32 + 33 + meta = with stdenv.lib; { 34 + homepage = https://git.sr.ht/~sircmpwn/hg.sr.ht; 35 + description = "Mercurial repository hosting service for the sr.ht network"; 36 + license = licenses.agpl3; 37 + maintainers = with maintainers; [ eadwu ]; 38 + }; 39 + }
+40
pkgs/applications/version-management/sourcehut/lists.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , srht, asyncpg, unidiff, aiosmtpd, emailthreads }: 4 + 5 + buildPythonPackage rec { 6 + pname = "listssrht"; 7 + version = "0.36.3"; 8 + 9 + src = fetchgit { 10 + url = "https://git.sr.ht/~sircmpwn/lists.sr.ht"; 11 + rev = version; 12 + sha256 = "1q2z2pjwz4zifsrkxab9b9jh1vzayjqych1cx3i4859f1swl2gwa"; 13 + }; 14 + 15 + patches = [ 16 + ./use-srht-path.patch 17 + ]; 18 + 19 + nativeBuildInputs = srht.nativeBuildInputs; 20 + 21 + propagatedBuildInputs = [ 22 + srht 23 + asyncpg 24 + unidiff 25 + aiosmtpd 26 + emailthreads 27 + ]; 28 + 29 + preBuild = '' 30 + export PKGVER=${version} 31 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 32 + ''; 33 + 34 + meta = with stdenv.lib; { 35 + homepage = https://git.sr.ht/~sircmpwn/lists.sr.ht; 36 + description = "Mailing list service for the sr.ht network"; 37 + license = licenses.agpl3; 38 + maintainers = with maintainers; [ eadwu ]; 39 + }; 40 + }
+37
pkgs/applications/version-management/sourcehut/man.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , srht, pygit2 }: 4 + 5 + buildPythonPackage rec { 6 + pname = "mansrht"; 7 + version = "0.12.4"; 8 + 9 + src = fetchgit { 10 + url = "https://git.sr.ht/~sircmpwn/man.sr.ht"; 11 + rev = version; 12 + sha256 = "1csnw71yh5zw7l17xmmxyskwiqbls0ynbbjrg45y5k1i3622mhiy"; 13 + }; 14 + 15 + patches = [ 16 + ./use-srht-path.patch 17 + ]; 18 + 19 + nativeBuildInputs = srht.nativeBuildInputs; 20 + 21 + propagatedBuildInputs = [ 22 + srht 23 + pygit2 24 + ]; 25 + 26 + preBuild = '' 27 + export PKGVER=${version} 28 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 29 + ''; 30 + 31 + meta = with stdenv.lib; { 32 + homepage = https://git.sr.ht/~sircmpwn/man.sr.ht; 33 + description = "Wiki service for the sr.ht network"; 34 + license = licenses.agpl3; 35 + maintainers = with maintainers; [ eadwu ]; 36 + }; 37 + }
+48
pkgs/applications/version-management/sourcehut/meta.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , pgpy, srht, redis, bcrypt, qrcode, stripe, zxcvbn, alembic, pystache 4 + , sshpubkeys, weasyprint, prometheus_client }: 5 + 6 + buildPythonPackage rec { 7 + pname = "metasrht"; 8 + version = "0.34.3"; 9 + 10 + src = fetchgit { 11 + url = "https://git.sr.ht/~sircmpwn/meta.sr.ht"; 12 + rev = version; 13 + sha256 = "1yj3npw1vlqawzj6q1mh6qryx009dg5prja9fn6rasfmxjn2gr7v"; 14 + }; 15 + 16 + nativeBuildInputs = srht.nativeBuildInputs; 17 + 18 + propagatedBuildInputs = [ 19 + pgpy 20 + srht 21 + redis 22 + bcrypt 23 + qrcode 24 + stripe 25 + zxcvbn 26 + alembic 27 + pystache 28 + sshpubkeys 29 + weasyprint 30 + prometheus_client 31 + ]; 32 + 33 + patches = [ 34 + ./use-srht-path.patch 35 + ]; 36 + 37 + preBuild = '' 38 + export PKGVER=${version} 39 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 40 + ''; 41 + 42 + meta = with stdenv.lib; { 43 + homepage = https://git.sr.ht/~sircmpwn/meta.sr.ht; 44 + description = "Account management service for the sr.ht network"; 45 + license = licenses.agpl3; 46 + maintainers = with maintainers; [ eadwu ]; 47 + }; 48 + }
+37
pkgs/applications/version-management/sourcehut/paste.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , srht, pyyaml }: 4 + 5 + buildPythonPackage rec { 6 + pname = "pastesrht"; 7 + version = "0.5.1"; 8 + 9 + src = fetchgit { 10 + url = "https://git.sr.ht/~sircmpwn/paste.sr.ht"; 11 + rev = version; 12 + sha256 = "0bzw03hcwi1pw16kliqjsr7kphqq3qw0pbpdjqkcs7jdr0a59vny"; 13 + }; 14 + 15 + patches = [ 16 + ./use-srht-path.patch 17 + ]; 18 + 19 + nativeBuildInputs = srht.nativeBuildInputs; 20 + 21 + propagatedBuildInputs = [ 22 + srht 23 + pyyaml 24 + ]; 25 + 26 + preBuild = '' 27 + export PKGVER=${version} 28 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 29 + ''; 30 + 31 + meta = with stdenv.lib; { 32 + homepage = https://git.sr.ht/~sircmpwn/paste.sr.ht; 33 + description = "Ad-hoc text file hosting service for the sr.ht network"; 34 + license = licenses.agpl3; 35 + maintainers = with maintainers; [ eadwu ]; 36 + }; 37 + }
+55
pkgs/applications/version-management/sourcehut/scm.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , srht, redis, pyyaml, buildsrht 3 + , writeText }: 4 + 5 + buildPythonPackage rec { 6 + pname = "scmsrht"; 7 + version = "0.13.3"; 8 + 9 + src = fetchgit { 10 + url = "https://git.sr.ht/~sircmpwn/scm.sr.ht"; 11 + rev = version; 12 + sha256 = "0bapddgfqrs27y6prd6kwpz6jdlr33zdqr6ci6ixi584a7z8z7d6"; 13 + }; 14 + 15 + nativeBuildInputs = srht.nativeBuildInputs; 16 + 17 + propagatedBuildInputs = [ 18 + srht 19 + redis 20 + pyyaml 21 + buildsrht 22 + ]; 23 + 24 + preBuild = '' 25 + export PKGVER=${version} 26 + ''; 27 + 28 + # No actual? tests but seems like it needs this anyway 29 + preCheck = let 30 + config = writeText "config.ini" '' 31 + [webhooks] 32 + private-key=K6JupPpnr0HnBjelKTQUSm3Ro9SgzEA2T2Zv472OvzI= 33 + 34 + [builds.sr.ht] 35 + origin=http://builds.sr.ht.local 36 + oauth-client-id= 37 + 38 + [meta.sr.ht] 39 + origin=http://meta.sr.ht.local 40 + ''; 41 + in '' 42 + # Validation needs config option(s) 43 + # webhooks <- ( private-key ) 44 + # meta.sr.ht <- ( origin ) 45 + # builds.sr.ht <- ( origin, oauth-client-id ) 46 + cp ${config} config.ini 47 + ''; 48 + 49 + meta = with stdenv.lib; { 50 + homepage = https://git.sr.ht/~sircmpwn/git.sr.ht; 51 + description = "Shared support code for sr.ht source control services."; 52 + license = licenses.agpl3; 53 + maintainers = with maintainers; [ eadwu ]; 54 + }; 55 + }
+42
pkgs/applications/version-management/sourcehut/todo.nix
··· 1 + { stdenv, fetchgit, buildPythonPackage 2 + , python 3 + , srht, redis, alembic, pystache }: 4 + 5 + buildPythonPackage rec { 6 + pname = "todosrht"; 7 + version = "0.46.8"; 8 + 9 + src = fetchgit { 10 + url = "https://git.sr.ht/~sircmpwn/todo.sr.ht"; 11 + rev = version; 12 + sha256 = "17nqqy81535jnkidjiqv8v2301w5wzbbvx4czib69aagw1l85gnn"; 13 + }; 14 + 15 + patches = [ 16 + ./use-srht-path.patch 17 + ]; 18 + 19 + nativeBuildInputs = srht.nativeBuildInputs; 20 + 21 + propagatedBuildInputs = [ 22 + srht 23 + redis 24 + alembic 25 + pystache 26 + ]; 27 + 28 + preBuild = '' 29 + export PKGVER=${version} 30 + export SRHT_PATH=${srht}/${python.sitePackages}/srht 31 + ''; 32 + 33 + # Tests require a network connection 34 + doCheck = false; 35 + 36 + meta = with stdenv.lib; { 37 + homepage = https://todo.sr.ht/~sircmpwn/todo.sr.ht; 38 + description = "Ticket tracking service for the sr.ht network"; 39 + license = licenses.agpl3; 40 + maintainers = with maintainers; [ eadwu ]; 41 + }; 42 + }
+54
pkgs/applications/version-management/sourcehut/update.sh
··· 1 + #! /usr/bin/env nix-shell 2 + #! nix-shell -i bash -p git mercurial common-updater-scripts 3 + 4 + cd "$(dirname "${BASH_SOURCE[0]}")" 5 + root=../../../.. 6 + 7 + default() { 8 + (cd "$root" && nix-instantiate --eval --strict -A "sourcehut.python.pkgs.$1.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/') 9 + } 10 + 11 + version() { 12 + (cd "$root" && nix-instantiate --eval --strict -A "sourcehut.python.pkgs.$1.version" | tr -d '"') 13 + } 14 + 15 + src_url() { 16 + (cd "$root" && nix-instantiate --eval --strict -A "sourcehut.python.pkgs.$1.src.drvAttrs.url" | tr -d '"') 17 + } 18 + 19 + get_latest_version() { 20 + src="$(src_url "$1")" 21 + tmp=$(mktemp -d) 22 + 23 + if [ "$1" = "hgsrht" ]; then 24 + hg clone "$src" "$tmp" &> /dev/null 25 + printf "%s" "$(cd "$tmp" && hg log --limit 1 --template '{latesttag}')" 26 + else 27 + git clone "$src" "$tmp" 28 + printf "%s" "$(cd "$tmp" && git describe $(git rev-list --tags --max-count=1))" 29 + fi 30 + } 31 + 32 + update_version() { 33 + default_nix="$(default "$1")" 34 + version_old="$(version "$1")" 35 + version="$(get_latest_version "$1")" 36 + 37 + (cd "$root" && update-source-version "sourcehut.python.pkgs.$1" "$version") 38 + 39 + git add "$default_nix" 40 + git commit -m "$1: $version_old -> $version" 41 + } 42 + 43 + services=( "srht" "buildsrht" "dispatchsrht" "gitsrht" "hgsrht" "listssrht" "mansrht" "metasrht" 44 + "pastesrht" "todosrht" "scmsrht" ) 45 + 46 + # Whether or not a specific service is requested 47 + if [ -n "$1" ]; then 48 + version="$(get_latest_version "$1")" 49 + (cd "$root" && update-source-version "sourcehut.python.pkgs.$1" "$version") 50 + else 51 + for service in "${services[@]}"; do 52 + update_version "$service" 53 + done 54 + fi
+43
pkgs/applications/version-management/sourcehut/use-srht-path.patch
··· 1 + diff --git a/setup.py b/setup.py 2 + index e6ecfb6..89fa92a 100755 3 + --- a/setup.py 4 + +++ b/setup.py 5 + @@ -5,28 +5,16 @@ import os 6 + import site 7 + import sys 8 + 9 + -if hasattr(site, 'getsitepackages'): 10 + - pkg_dirs = site.getsitepackages() 11 + - if site.getusersitepackages(): 12 + - pkg_dirs.append(site.getusersitepackages()) 13 + - for pkg_dir in pkg_dirs: 14 + - srht_path = os.path.join(pkg_dir, "srht") 15 + - if os.path.isdir(srht_path): 16 + - break 17 + - else: 18 + - raise Exception("Can't find core srht module in your site packages " 19 + - "directories. Please install it first.") 20 + -else: 21 + - srht_path = os.getenv("SRHT_PATH") 22 + - if not srht_path: 23 + - raise Exception("You're running inside a virtual environment. " 24 + - "Due to virtualenv limitations, you need to set the " 25 + - "$SRHT_PATH environment variable to the path of the " 26 + - "core srht module.") 27 + - elif not os.path.isdir(srht_path): 28 + - raise Exception( 29 + - "The $SRHT_PATH environment variable points to an invalid " 30 + - "directory: {}".format(srht_path)) 31 + +srht_path = os.getenv("SRHT_PATH") 32 + +if not srht_path: 33 + + raise Exception("You're running inside a virtual environment. " 34 + + "Due to virtualenv limitations, you need to set the " 35 + + "$SRHT_PATH environment variable to the path of the " 36 + + "core srht module.") 37 + +elif not os.path.isdir(srht_path): 38 + + raise Exception( 39 + + "The $SRHT_PATH environment variable points to an invalid " 40 + + "directory: {}".format(srht_path)) 41 + 42 + subp = subprocess.run(["make", "SRHT_PATH=" + srht_path]) 43 + if subp.returncode != 0:
+2
pkgs/top-level/all-packages.nix
··· 6144 6144 6145 6145 srcml = callPackage ../applications/version-management/srcml { }; 6146 6146 6147 + sourcehut = callPackage ../applications/version-management/sourcehut { }; 6148 + 6147 6149 sshfs-fuse = callPackage ../tools/filesystems/sshfs-fuse { }; 6148 6150 sshfs = sshfs-fuse; # added 2017-08-14 6149 6151