Skip to content

Commit 943a30a

Browse files
committed
chore: improve Docker image + use explicit makepkg conf
1 parent 0b64bdb commit 943a30a

File tree

5 files changed

+166
-4
lines changed

5 files changed

+166
-4
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,19 @@ jobs:
4949
run: |
5050
cd /home/pcr
5151
52-
# Create artifacts
52+
# Debug
53+
whoami
54+
pwd
55+
ls -lah
56+
57+
# Get sources
5358
./pull.bash
59+
60+
# Conf
61+
mkdir -p ~/.config/pacman
62+
cp makepkg.conf ~/.config/pacman
63+
64+
# Create artifacts
5465
makepkg
5566
5667
# Unpack artifacts

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ RUN pacman -Syu --noconfirm && \
4848
chmod 0440 /etc/sudoers.d/user
4949

5050
WORKDIR /home/pcr
51-
USER pcr
5251

5352
COPY PKGBUILD .
5453
COPY pull.bash .
54+
COPY makepkg.conf .
55+
56+
RUN chown -R pcr:pcr /home/pcr
57+
USER pcr
5558

5659
ENV CC="/usr/bin/clang" \
5760
CXX="/usr/bin/clang++" \
@@ -63,5 +66,5 @@ ENV CC="/usr/bin/clang" \
6366
CXXFLAGS="-g -flto -fuse-ld=lld"
6467

6568
RUN ["./pull.bash"]
66-
RUN makepkg && \
69+
RUN makepkg --config makepkg.conf && \
6770
rm emacs-1-1-x86_64.pkg.tar.zst

PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ package() {
5151
# fix user/root permissions on usr/share files
5252
find "$pkgdir"/usr/share/emacs/ | xargs chown root:root
5353

54-
# fix permssions on /var/games
54+
# fix permissions on /var/games
5555
mkdir -p "$pkgdir"/var/games/emacs
5656
chmod 775 "$pkgdir"/var/games
5757
chmod 775 "$pkgdir"/var/games/emacs

makepkg.conf

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
#!/hint/bash
2+
#
3+
# /etc/makepkg.conf
4+
#
5+
6+
#########################################################################
7+
# SOURCE ACQUISITION
8+
#########################################################################
9+
#
10+
#-- The download utilities that makepkg should use to acquire sources
11+
# Format: 'protocol::agent'
12+
DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
13+
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
14+
'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
15+
'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
16+
'rsync::/usr/bin/rsync --no-motd -z %u %o'
17+
'scp::/usr/bin/scp -C %u %o')
18+
19+
# Other common tools:
20+
# /usr/bin/snarf
21+
# /usr/bin/lftpget -c
22+
# /usr/bin/wget
23+
24+
#-- The package required by makepkg to download VCS sources
25+
# Format: 'protocol::package'
26+
VCSCLIENTS=('bzr::bzr'
27+
'git::git'
28+
'hg::mercurial'
29+
'svn::subversion')
30+
31+
#########################################################################
32+
# ARCHITECTURE, COMPILE FLAGS
33+
#########################################################################
34+
#
35+
CARCH="x86_64"
36+
CHOST="x86_64-pc-linux-gnu"
37+
38+
#-- Compiler and Linker Flags
39+
CPPFLAGS="-D_FORTIFY_SOURCE=2"
40+
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
41+
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
42+
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
43+
#RUSTFLAGS="-C opt-level=2"
44+
#-- Make Flags: change this for DistCC/SMP systems
45+
#MAKEFLAGS="-j2"
46+
#-- Debugging flags
47+
DEBUG_CFLAGS="-g -fvar-tracking-assignments"
48+
DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
49+
#DEBUG_RUSTFLAGS="-C debuginfo=2"
50+
51+
#########################################################################
52+
# BUILD ENVIRONMENT
53+
#########################################################################
54+
#
55+
# Defaults: BUILDENV=(!distcc !color !ccache check !sign)
56+
# A negated environment option will do the opposite of the comments below.
57+
#
58+
#-- distcc: Use the Distributed C/C++/ObjC compiler
59+
#-- color: Colorize output messages
60+
#-- ccache: Use ccache to cache compilation
61+
#-- check: Run the check() function if present in the PKGBUILD
62+
#-- sign: Generate PGP signature file
63+
#
64+
BUILDENV=(!distcc color !ccache check !sign)
65+
#
66+
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
67+
#-- specify a space-delimited list of hosts running in the DistCC cluster.
68+
#DISTCC_HOSTS=""
69+
#
70+
#-- Specify a directory for package building.
71+
#BUILDDIR=/tmp/makepkg
72+
73+
#########################################################################
74+
# GLOBAL PACKAGE OPTIONS
75+
# These are default values for the options=() settings
76+
#########################################################################
77+
#
78+
# Default: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug)
79+
# A negated option will do the opposite of the comments below.
80+
#
81+
#-- strip: Strip symbols from binaries/libraries
82+
#-- docs: Save doc directories specified by DOC_DIRS
83+
#-- libtool: Leave libtool (.la) files in packages
84+
#-- staticlibs: Leave static library (.a) files in packages
85+
#-- emptydirs: Leave empty directories in packages
86+
#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
87+
#-- purge: Remove files specified by PURGE_TARGETS
88+
#-- debug: Add debugging flags as specified in DEBUG_* variables
89+
#
90+
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
91+
92+
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
93+
INTEGRITY_CHECK=(md5)
94+
#-- Options to be used when stripping binaries. See `man strip' for details.
95+
STRIP_BINARIES="--strip-all"
96+
#-- Options to be used when stripping shared libraries. See `man strip' for details.
97+
STRIP_SHARED="--strip-unneeded"
98+
#-- Options to be used when stripping static libraries. See `man strip' for details.
99+
STRIP_STATIC="--strip-debug"
100+
#-- Manual (man and info) directories to compress (if zipman is specified)
101+
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
102+
#-- Doc directories to remove (if !docs is specified)
103+
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
104+
#-- Files to be removed from all packages (if purge is specified)
105+
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
106+
#-- Directory to store source code in for debug packages
107+
DBGSRCDIR="/usr/src/debug"
108+
109+
#########################################################################
110+
# PACKAGE OUTPUT
111+
#########################################################################
112+
#
113+
# Default: put built package and cached source in build directory
114+
#
115+
#-- Destination: specify a fixed directory where all packages will be placed
116+
#PKGDEST=/home/packages
117+
#-- Source cache: specify a fixed directory where source files will be cached
118+
#SRCDEST=/home/sources
119+
#-- Source packages: specify a fixed directory where all src packages will be placed
120+
#SRCPKGDEST=/home/srcpackages
121+
#-- Log files: specify a fixed directory where all log files will be placed
122+
#LOGDEST=/home/makepkglogs
123+
#-- Packager: name/email of the person or organization building packages
124+
#PACKAGER="John Doe <john@doe.com>"
125+
#-- Specify a key to use for package signing
126+
#GPGKEY=""
127+
128+
#########################################################################
129+
# COMPRESSION DEFAULTS
130+
#########################################################################
131+
#
132+
COMPRESSGZ=(gzip -c -f -n)
133+
COMPRESSBZ2=(bzip2 -c -f)
134+
COMPRESSXZ=(xz -c -z -)
135+
COMPRESSZST=(zstd -c -z -q -)
136+
COMPRESSLRZ=(lrzip -q)
137+
COMPRESSLZO=(lzop -q)
138+
COMPRESSZ=(compress -c -f)
139+
COMPRESSLZ4=(lz4 -q)
140+
COMPRESSLZ=(lzip -c -f)
141+
142+
#########################################################################
143+
# EXTENSION DEFAULTS
144+
#########################################################################
145+
#
146+
PKGEXT='.pkg.tar.zst'
147+
SRCEXT='.src.tar.gz'

pull.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
if [[ -d "emacs" ]]; then
44
cd emacs
5+
git checkout .
56
git pull --rebase origin pgtk-nativecomp
67
else
78
git clone --depth=1 https://github.com/flatwhatson/emacs

0 commit comments

Comments
 (0)