[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using dpkg-deb in a Guix package definition
From: |
Benjamin Slade |
Subject: |
Re: using dpkg-deb in a Guix package definition |
Date: |
Fri, 13 May 2022 12:50:17 -0600 |
User-agent: |
mu4e 1.6.10; emacs 28.1.50 |
On Fri, 06 May 2022 08:39:48 -0600 (1 week, 4 hours, 10 minutes ago), Katherine
Cox-Buday <cox.katherine.e@gmail.com> wrote:
> Benjamin Slade <beoram@gmail.com> writes:
> > Are there any good examples of writing a Guix package definition using dpkg?
> I'm not sure if this helps, but I had to consume a deb and wrote a package
> that
> unpacks it to get the binary:
> <https://github.com/kat-co/guix-channels/blob/non-free/non-free/packages/security.scm#L122-L127>=
> --
> Katherine
Thanks! I got a partial definition done; it at least downloads and dpkg's,
though I have to figure out what to patchelf still (and would rather have in
/bin than /opt).
,----
| (use-modules (guix packages)
| (guix download)
| ((guix licenses) #:prefix license:)
| (gnu packages)
| (gnu packages debian)
| (gnu packages gnome)
| (gnu packages glib)
| (gnu packages gtk)
| (guix build-system)
| (nonguix build-system binary)
| (gnu packages pkg-config))
|
| (package
| (name "brave-browser")
| (version "1.38.111")
| (source
| (origin
| (method url-fetch)
| (uri (string-append
| "https://github.com/brave/brave-browser/releases/download/v"
| version "/brave-browser_" version "_amd64.deb"))
| (sha256
| (base32 "1fx2gbp21m7adclykq7nl21qm5hmlpcbnz0fdybmqfchs29d0i5i"))))
| (build-system binary-build-system)
| (arguments
| `(#:install-plan
| '(("opt/" "opt"))
| #:patchelf-plan
| '(("opt/brave.com/brave/brave" ("libc"))
| ("opt/brave.com/brave/brave-browser" ("libc")))
| #:phases
| (modify-phases %standard-phases
| (replace 'unpack
| (lambda* (#:key inputs source #:allow-other-keys)
| (let ((dpkg (string-append (assoc-ref inputs
"dpkg")
| "/bin/dpkg")))
| (invoke dpkg "-x" source ".")))))))
| ; need something like: dpkg-deb --fsys-tarfile $src | tar -x
--no-same-permissions --no-same-owner
| (native-inputs
| `(("dpkg" ,dpkg)
| ;; ("wrapGAppsHook" ,wrapGAppsHooks)
| ))
| (inputs
| `(("glib" ,glib)
| ("gtk+" ,gtk+)
| ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)))
| (supported-systems '("x86_64-linux"))
| (home-page "https://brave.com/")
| (synopsis "Brave browser")
| (description "Brave browser based on Chromium.")
| (license (list license:mpl2.0)))
`----