Coder Social home page Coder Social logo

whynothugo / docker-makepkg Goto Github PK

View Code? Open in Web Editor NEW
43.0 5.0 21.0 175 KB

A Docker image that builds a PKGBUILD.

Home Page: https://git.sr.ht/~whynothugo/docker-makepkg

License: ISC License

Shell 48.16% Dockerfile 51.84%
docker archlinux build makepkg pacman packaging arch-linux

docker-makepkg's Introduction

docker-makepkg

build status

This docker image is intended to tests PKGBUILDs, by installing dependencies and running makepkg -f in a clean Arch installation. It is intended to be used by packagers, both via CI, and on non-ArchLinux environments.

The package can be saved to the current director by adding -e EXPORT_PKG=1, and the updated .SRCINFO file for the built package with -e EXPORT_SRC=1.

Usage locally

docker run -v $PWD:/pkg -e SYNC_DATABASE=1 whynothugo/makepkg

Or export the built package file to the working directory

docker run -e EXPORT_PKG=1 -v $PWD:/pkg whynothugo/makepkg

Or export the updated .SRCINFO for the package

docker run -e EXPORT_SRC=1 -v $PWD:/pkg whynothugo/makepkg

If you are running Arch, you can share the mirror list from your host by adding -v /etc/pacman.d/mirrorlist:/etc/pacman.d/mirrorlist:ro.

Usage with travis

Generally, this should be enough:

sudo: required

services:
 - docker

script:
  - docker run -v $TRAVIS_BUILD_DIR:/pkg whynothugo/makepkg

Usage with GitLab CI

Since GitLab CI uses Docker, it should be trivial to use these images there too.

Extra details

  • base-devel is pre-installed.
  • All depends will be installed (including AUR packages using paru).
  • You may pass SYNC_DATABASE=1 to force a pacman -Sy to refresh the database, since it updates quite frequently.
  • GPG keys used to verify signatures are auto-fetched.

Licence

This repository is licensed under the ISC licence. See LICENCE for details.

docker-makepkg's People

Contributors

actions-user avatar carlsmedstad avatar evanpurkhiser avatar firecat53 avatar pre-commit-ci[bot] avatar shiftkey avatar thor2002ro avatar whynothugo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-makepkg's Issues

Test it via CI

Have CI actually test the image (both with and without EXPORT_PACKAGE.

pod2man not found during builds

build output says that pod2man is not found, even when perl package is installed

looks like the build users PATH is missing /usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Copy compiled files from docker container to the working directory of the host.

How can I automatically copy the compiled files to the working directory of the host? This is the end of the job:

Copying ext4_x64.efi
Copying ext2_x64.efi
Copying hfs_x64.efi
Copying iso9660_x64.efi
Copying reiserfs_x64.efi
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> WARNING: Package contains reference to $srcdir
usr/share/refind/tools_x64/gptsync_x64.efi
usr/share/refind/drivers_x64/hfs_x64.efi
usr/share/refind/drivers_x64/ext4_x64.efi
usr/share/refind/drivers_x64/ext2_x64.efi
usr/share/refind/drivers_x64/iso9660_x64.efi
usr/share/refind/drivers_x64/reiserfs_x64.efi
usr/share/refind/refind_x64.efi
==> Creating package "refind-efi-git"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: refind-efi-git 0.13.2.8.r793.g54177c6-1 (Wed 17 Nov 2021 11:42:44 PM UTC)
==> Cleaning up...

According to the log they are in /usr/share/refind/.

Packages built in docker-makepkg may hide PKGBUILD dependency issues.

Example: keepmenu-git depends on python-pynput which pulls in python-setuptools. Now keepmenu-git builds successfully with docker-makepkg.

However, if python-pynput is built separately and then keepmenu-git is built in a clean chroot using the Arch devtools like:

$ extra-x86_64-build -- -I ~/python-pynput-1.7.4-1-any.pkg.tar.zst

the build will fail because python-setuptools should be a dependency for this build but it's not required by the PKGBUILD (which was my mistake, pointed out by someone else).

So, if paru builds multiple dependency packages, the previous makedepends packages should be removed before building the final package.

Error during dependencies installation

I get this error during dependencies installation:

error: python-pivy: signature from "Alexander F. Rødseth <[email protected]>" is marginal trust
:: File /var/cache/pacman/pkg/python-pivy-0.6.7-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
error: failed to commit transaction (invalid or corrupted package)
Do you want to delete it? [Y/n] 
Errors occurred, no packages were upgraded.
Error: Process completed with exit code 1.

I don't know whether it is related to your image or it's Arch stuff, I'll leave it to you to decide.

(automatically) update image

I'd like to use this image for my own AUR builds. However, the base of this image is already quite dated now. Any chance to get some automatic updates to this image to ensure that builds are created with an up to date archlinux?

Supporting non-official packages as dependencies

Hi there! Awesome docker image, I recently set this up for my personal PKGBUILD repo, it's really cool!

Unfortunately some of my packages are failing to build at the moment using this, as they depend on some AUR packages (and perhaps in the future maybe even packages not in the AUR).

I'm wondering what we might be able to do to expand this to support installation of dependencies first. I was thinking something simple like specifying an environment variable, something like

export aur_deps="homebridge-git another-dep-git"
docker run -v -e aur_deps $(pwd):/pkg whynothugo/makepkg

Then the script would just install each one before running makepkg.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.