aboutsummaryrefslogtreecommitdiff
path: root/guix-module-dir/hydrilla.scm
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2023-08-24 20:10:34 +0200
committerWojtek Kosior <koszko@koszko.org>2023-08-25 12:19:19 +0200
commitd16a726e958aa78d5d9f3515eb18b589e27bdac1 (patch)
tree82c4e2b412fd5341134998e7e3cd8d66d738f9bf /guix-module-dir/hydrilla.scm
parent0792f29ea1fcc4386246cfc26bf4b2fbe3a5f9d6 (diff)
downloadhaketilo-hydrilla-d16a726e958aa78d5d9f3515eb18b589e27bdac1.tar.gz
haketilo-hydrilla-d16a726e958aa78d5d9f3515eb18b589e27bdac1.zip
make it possible to build&test&use just hydrilla without haketilo
Diffstat (limited to 'guix-module-dir/hydrilla.scm')
-rw-r--r--guix-module-dir/hydrilla.scm100
1 files changed, 25 insertions, 75 deletions
diff --git a/guix-module-dir/hydrilla.scm b/guix-module-dir/hydrilla.scm
index 99489d9..121b77d 100644
--- a/guix-module-dir/hydrilla.scm
+++ b/guix-module-dir/hydrilla.scm
@@ -4,61 +4,28 @@
;;
;; Available under the terms of Creative Commons Zero v1.0 Universal.
-(define-module (hydrilla))
-
-(use-modules
- (ice-9 rdelim)
- (ice-9 regex))
-
-(define %source-dir
- (let* ((this-file (search-path %load-path "hydrilla.scm"))
- (proj-dir (dirname (dirname this-file))))
- (if (absolute-file-name? proj-dir)
- proj-dir
- (string-append (getcwd) "/" proj-dir))))
-
-;; The PKG-INFO file is generated when running `python3 -m build -s` or similar.
-;; It is also automatically included in the source release tarballs.
-(define %pkg-info-path
- (string-append %source-dir "/src/hydrilla.egg-info/PKG-INFO"))
-
-(define %hydrilla-version
- (if (access? %pkg-info-path R_OK)
- (call-with-input-file %pkg-info-path
- (lambda (port)
- (let ((process-line
- (lambda (self-ref)
- (let ((match-result
- (string-match "^Version: (.*)" (read-line port))))
- (if match-result (match:substring match-result 1)
- (self-ref self-ref))))))
- (process-line process-line))))
- "unknown"))
-
-(define source-tarball-name
- (string-append "hydrilla-" %hydrilla-version ".tar.gz"))
-
-(use-modules
- (guix packages)
- (guix download)
- (guix git-download)
- (guix build-system python)
- (guix gexp)
- ((guix licenses) #:prefix license:)
- (gnu packages python-build)
- (gnu packages python-xyz)
- (gnu packages python-crypto)
- (gnu packages compression)
- (gnu packages python-compression)
- (gnu packages xdisorg)
- (gnu packages serialization)
- (gnu packages protobuf)
- (gnu packages python-web)
- (gnu packages check)
- (gnu packages sphinx)
- (gnu packages python-check)
- (gnu packages license)
- (gnu packages gnupg))
+(define-module (hydrilla)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix git-download)
+ #:use-module (guix build-system python)
+ #:use-module (guix gexp)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (gnu packages python-build)
+ #:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages python-crypto)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu packages python-compression)
+ #:use-module (gnu packages xdisorg)
+ #:use-module (gnu packages serialization)
+ #:use-module (gnu packages protobuf)
+ #:use-module (gnu packages python-web)
+ #:use-module (gnu packages check)
+ #:use-module (gnu packages sphinx)
+ #:use-module (gnu packages python-check)
+ #:use-module (gnu packages license)
+ #:use-module (gnu packages gnupg)
+ #:use-module (hydrilla-base))
(define-public python-kaitaistruct
(package
@@ -245,24 +212,6 @@ replay web traffic such as HTTP/1, HTTP/2, WebSockets, or any other
SSL/TLS-protected protocols.")
(license license:expat)))
-(define-public python-types-requests
- (package
- (name "python-types-requests")
- (version "2.26.0")
- (source (origin
- (method url-fetch)
- (uri (pypi-uri "types-requests" version))
- (sha256
- (base32
- "10sq8jarr642vhw53k6zbf3hn2b8xfyrckwfngml4fj19g1whpnz"))))
- (build-system python-build-system)
- (home-page "https://github.com/python/typeshed")
- (synopsis "Typing stubs for requests")
- (description
- "This package provides a collection of library stubs for Python, with
-static types.")
- (license license:asl2.0)))
-
(define-public hydrilla
(package
(name "hydrilla")
@@ -270,7 +219,7 @@ static types.")
(source
;; setuptools_scm makes it impossible to build directly from git
;; checkout. We instead build from source tarball generated under ./dist/.
- (local-file (string-append %source-dir "/dist/" source-tarball-name)))
+ (local-file (string-append %source-dir "/dist/" %source-tarball-name)))
(build-system python-build-system)
(arguments
`(#:modules ((ice-9 match)
@@ -311,7 +260,7 @@ static types.")
python-pytest
python-pypa-build
python-mypy
- python-types-requests))
+ python-types-requests-2.26))
(home-page "https://hydrillabugs.koszko.org/projects/haketilo/wiki")
(synopsis "Block JavaScript and add custom logic to web pages")
(description "Haketilo HTTP proxy facilitates viewing of websites while
@@ -319,3 +268,4 @@ having their original JavaScript replaced by user-provided scripts. Haketilo
combines the functionalities of content blocker and user script manager. It can
be used with its script repository, Hydrilla.")
(license (list license:agpl3+ license:gpl3+ license:cc0))))
+