-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrockcraft.yaml
732 lines (711 loc) · 21.2 KB
/
rockcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
name: ps-printer-app
base: [email protected]
version: '20240504-11'
summary: PostScript Printer Application
description: |
The PostScript Printer Application is a PAPPL (Printer Application Framework) based Printer Application
to support PostScript printers.
PAPPL is a simple C-based framework/library for developing
Printer Applications, which are the recommended replacement for
printer drivers.
license: Apache-2.0
platforms:
arm64:
amd64:
armhf:
# We use the upstream versioning of foomatic-db as it contains most of
# the manufacturer-supplied PostScript PPD files
adopt-info: foomatic-db
# Only build on the architectures supported
services:
dbus:
command: /scripts/run-dbus.sh
override: replace
on-failure: restart
startup: enabled
ps-printer-app:
command: /scripts/start-server.sh
override: replace
on-failure: shutdown
startup: enabled
after: [dbus]
parts:
pappl:
source: https://github.com/michaelrsweet/pappl
source-type: git
source-tag: 'v1.4.8'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '2'
# no-9x-revisions: true
plugin: autotools
override-build: |
set -eux
# Raise the supported number of vendor-specific options/attributes in
# PAPPL to 256, as the original 32 can be too small for some busy PPD
# files
perl -p -i -e 's/(define\s+PAPPL_MAX_VENDOR\s+)32/\1 256/' pappl/printer.h
# De-activate log-rotating. It does not work with the forked processes
# of the filters
perl -p -i -e 's/(system->logmaxsize\s+=).*/\1 0;/' pappl/system.c
# As we do not use PAPPL's own backends but the CUPS backends using the
# "cups" device scheme of pappl-retrofit, we let the manual "Network
# Printer" device on the "Add Printer" page of the web interface use a
# "cups:socket://..." URI instead of simply "socket://..."
perl -p -i -e 's/(httpAssembleURI\(.*?)"socket"(.*?\))/\1"cups:socket"\2/' pappl/system-webif.c
# PAPPL's build system does not insert the LDFLAGS when linking.
# Patching Makedefs.in to fix this
perl -p -i -e 's/^(\s*DSOFLAGS\s*=\s*\S*\s+)/\1\$\(LDFLAGS\) /' Makedefs.in
craftctl default
autotools-configure-parameters:
- --prefix=/usr
- --enable-libjpeg
- --enable-libpng
- --enable-libusb
- --with-dnssd=avahi
build-packages:
- libavahi-client-dev
- libgnutls28-dev
- libjpeg-dev
- libpam0g-dev
- libpng-dev
- libusb-1.0-0-dev
- zlib1g-dev
- perl-base
stage-packages:
# We have libavahi-client3 already in this Snap via the "cups" part,
# so here we do not stage it again to avoid any file clashes.
#- libavahi-client3
- libpng16-16
- libusb-1.0-0
prime:
- -etc/fonts
- -var
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- -usr/include
- -usr/lib/pkgconfig
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
after: [cups]
pappl-retrofit:
source: https://github.com/openprinting/pappl-retrofit
source-type: git
# source-tag: '1.0b2'
source-depth: 1
# ext:updatesnap
# version-format:
# ignore: true
# format: '%V'
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
# To find the libraries built in this Snap
build-environment:
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib"
build-packages:
- autoconf
- automake
- libtool
- autotools-dev
- pkg-config
- perl-base
stage-packages:
- libusb-1.0-0
organize:
usr/share/legacy-printer-app/testpage.pdf: usr/share/ps-printer-app/testpage.pdf
prime:
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- usr/share/ps-printer-app/testpage.pdf
- -var
- -usr/bin/legacy-printer-app
- -usr/include
- -usr/lib/pkgconfig
- -usr/lib/legacy-printer-app
- -usr/share/legacy-printer-app
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
after: [cups, pappl, libcupsfilters, libppd]
qpdf:
source: https://github.com/qpdf/qpdf/
source-type: git
source-tag: 'v11.9.1'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '12'
# no-9x-revisions: true
plugin: cmake
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/
- -DCMAKE_BUILD_RPATH_USE_ORIGIN=1
- -DUSE_IMPLICIT_CRYPTO=0
- -DREQUIRE_CRYPTO_GNUTLS=1
- -DSHOW_FAILED_TEST_OUTPUT=1
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
- -DQTEST_COLOR=0
build-packages:
- cmake
- g++
- libjpeg-dev
- zlib1g-dev
- libgnutls28-dev
stage-packages:
- libjpeg-turbo8
# stage:
# # The *.la file which gets installed by "make install" contains a
# # wrong prefix, breaking parts of this Snap which use this library
# - -usr/lib/lib*.la
prime:
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- -etc/fonts
- -var
- -usr/include
- -share/man
- -share/doc
- -share/lintian
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- -usr/lib/libqpdf.a
- -usr/lib/libqpdf.la
- -usr/lib/pkgconfig
ghostscript:
#source: https://git.ghostscript.com/ghostpdl.git
source: https://github.com/ArtifexSoftware/ghostpdl.git
source-type: git
source-tag: 'ghostpdl-10.05.0-test-base-001'
source-depth: 1
# ext:updatesnap
# version-format:
# format: "ghostpdl-%M.%m.%R"
# lower-than: '11'
# no-9x-revisions: true
plugin: autotools
# We only need PostScript output, for converting PDF input
autotools-configure-parameters:
- --prefix=/usr
- --without-x
- --disable-gtk
- --with-drivers=ps2write
- --enable-freetype
- --without-tesseract
- --without-gpdl
- --without-pcl
- --without-xps
stage-packages:
- libpaper1
- libfontconfig1
- libfreetype6
- libpng16-16
prime:
- usr/bin/gs
- lib/*/lib*.so*
- usr/lib/*/lib*.so*
- usr/share/ghostscript
- -etc/fonts
- -var
- -usr/include
- -usr/lib/pkgconfig
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
after: [cups]
cups:
source: https://github.com/OpenPrinting/cups
source-type: git
source-tag: 'v2.4.11'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# We only need libcups (with headers, ...) and the backends
override-build: |
set -eux
patch -p1 < $CRAFT_PROJECT_DIR/patches/cups-dnssd-backend-socket-only.patch
# We use "--with-tls=gnutls" here, as current CUPS defaults to SSL here
# and this is buggy, causing a segfault when serving out a HTTPS web
# interface page.
./configure --with-tls=gnutls
cd cups
make
cd ..
cd backend
# Have USB quirk ffiles in user-modifiable space for debugging
perl -p -i -e 's/"CUPS_DATADIR"/"USB_QUIRK_DIR"/' usb-libusb.c
make snmp dnssd socket ipp ipps lpd usb
cd ..
mkdir -p $CRAFT_PART_INSTALL/usr/lib
cp cups/libcups.a $CRAFT_PART_INSTALL/usr/lib/
cp -P cups/libcups.so* $CRAFT_PART_INSTALL/usr/lib/
mkdir -p $CRAFT_PART_INSTALL/usr/include/cups
cp cups/*.h $CRAFT_PART_INSTALL/usr/include/cups/
mkdir -p $CRAFT_PART_INSTALL/usr/bin
cp cups-config $CRAFT_PART_INSTALL/usr/bin/
mkdir -p $CRAFT_PART_INSTALL/usr/lib/ps-printer-app/backend/
( cd backend; \
cp snmp dnssd socket ipp ipps lpd usb org.cups.usb-quirks $CRAFT_PART_INSTALL/usr/lib/ps-printer-app/backend/ \
)
cp conf/snmp.conf $CRAFT_PART_INSTALL/usr/lib/ps-printer-app/backend/
#craftctl default
build-packages:
- patch
- gettext
- autoconf
- automake
- libtool
- autotools-dev
- pkg-config
- libavahi-client-dev
- libavahi-common-dev
- libavahi-compat-libdnssd-dev
- libdbus-1-dev
- libfontconfig1-dev
- libfreetype6-dev
- libgnutls28-dev
- libjpeg-dev
- libldap2-dev
- libkrb5-dev
- libpam0g-dev
- libpaper-dev
- libpng-dev
- libusb-1.0-0-dev
- perl-base
stage-packages:
- libusb-1.0-0
- libavahi-common3
- libavahi-client3
- libicu70
prime:
- -etc/fonts
- -var
- -usr/include
- -usr/lib/pkgconfig
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- usr/lib/ps-printer-app/backend/*
# Reported unused by snapcraft linter
- -usr/lib/*/libdconf.*
- -usr/lib/*/libicuio.*
- -usr/lib/*/libicutest.*
- -usr/lib/*/libicutu.*
- -usr/lib/*/libicuuc.*
- -usr/lib/*/libicui18n.*
libcupsfilters:
source: https://github.com/OpenPrinting/libcupsfilters
source-type: git
source-tag: '2.1.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# We only need libcupsfilters itself. so we simply do not prime the
# auxiliary files (/usr/share)
autotools-configure-parameters:
- --prefix=/usr
- --disable-avahi
- --disable-mutool
# To find the libraries built in this Snap
build-environment:
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib"
build-packages:
- gettext
- autoconf
- automake
- autotools-dev
- pkg-config
- g++
- sharutils
- liblcms2-dev
- libpoppler-cpp-dev
- libpng-dev
- libjpeg-dev
- libtiff5-dev
- zlib1g-dev
- libfontconfig1-dev
- libdbus-1-dev
- libexif-dev
stage-packages:
- libpoppler-cpp0v5
- libjbig0
- liblcms2-2
- libnspr4
- libnss3
- libopenjp2-7
- libpoppler118
- libtiff5
- libwebp7
- libexif12
stage:
# The *.la file which gets installed by "make install" contains a
# wrong prefix, breaking parts of this Snap which use this library
- -usr/lib/lib*.la
prime:
- -etc
- -var
- -usr/include
- -usr/lib/pkgconfig
- usr/share/cups
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- usr/lib/*/nss
# Reported unused by snapcraft linter
- -usr/lib/*/libssl3.*
after: [cups, qpdf, ghostscript]
libppd:
source: https://github.com/OpenPrinting/libppd
source-type: git
source-tag: '2.1.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# We only need libppd itself, so we also do not prime the auxiliary files
# here.
autotools-configure-parameters:
- --prefix=/usr
- --disable-mutool
- --disable-pdftocairo
- --disable-acroread
# To find the libraries built in this Snap
build-environment:
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib"
build-packages:
- gettext
- autoconf
- automake
- autotools-dev
- pkg-config
- g++
- sharutils
- poppler-utils
prime:
- -etc
- -var
- -usr/include
- -usr/lib/pkgconfig
- -usr/share/ppdc
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- usr/lib/*/nss
after: [cups, ghostscript, libcupsfilters]
cups-filters:
source: https://github.com/OpenPrinting/cups-filters
source-type: git
source-tag: '2.0.1'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# To find the libraries built in this Snap
build-environment:
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib"
# We only need pdftops and foomatic-rip (for PIN-protected printing
# on Ricoh and OEM)
override-build: |
set -eux
./autogen.sh
./configure --disable-mutool
make foomatic-rip
make pdftops
mkdir -p $CRAFT_PART_INSTALL
cp foomatic-rip $CRAFT_PART_INSTALL
cp pdftops $CRAFT_PART_INSTALL
#craftctl default
build-packages:
- gettext
- autoconf
- automake
- autotools-dev
- pkg-config
- g++
- sharutils
stage-packages:
- poppler-utils
organize:
foomatic-rip: usr/lib/ps-printer-app/filter/foomatic-rip
pdftops: usr/lib/ps-printer-app/filter/pdftops
prime:
- -etc/fonts
- -var
- -usr/include
- -usr/lib/pkgconfig
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- usr/lib/*/nss
- usr/bin/pdftops
- usr/lib/ps-printer-app
# Reported unused by snapcraft linter
- -usr/lib/*/libcairo.*
- -usr/lib/*/libssl3.*
- -usr/lib/*/libX11.*
- -usr/lib/*/libXau.*
- -usr/lib/*/libXdmcp.*
- -usr/lib/*/libXext.*
- -usr/lib/*/libXrender.*
- -usr/lib/*/libpixman-1.*
- -usr/lib/*/libxcb.*
- -usr/lib/*/libxcb-render.*
- -usr/lib/*/libxcb-shm.*
after: [cups, ghostscript, libcupsfilters, libppd]
pyppd:
source: https://github.com/OpenPrinting/pyppd
source-type: git
source-tag: 'release-1-1-0'
source-depth: 1
build-packages:
- python3.10
stage-packages:
- python3.10
# ext:updatesnap
# version-format:
# format: "release-%M-%m-%R"
# lower-than: '2'
# no-9x-revisions: true
plugin: python
override-prime: ""
foomatic-db:
source: https://github.com/OpenPrinting/foomatic-db
source-type: git
source-tag: '20240504'
source-depth: 1
# ext:updatesnap
# version-format:
# format: '%V'
plugin: nil
override-build: |
set -eux
# Remove non-PostScript manufacturer PPD files
rm -rf db/source/PPD/*/PDF
rm -rf db/source/PPD/*/PXL
rm -rf db/source/PPD/*/PCL5
# Remove executable bits from PPD files
find db/source/PPD -executable -type f -print0 | xargs -0 chmod -x || :
# Remove non-PPD files from PPD file directories
find db/source/PPD -type f \! -name '*.ppd' -print0 | xargs -0 rm || :
# Correct common errors in PPD files: "*CloseUI" without ':' and
# "*1284DeviceId" instead of "*1284DeviceID"
for f in `find db/source/PPD -name '*.ppd'`; do perl -p -i -e 's/^\*CloseUI(\s+)/*CloseUI:\1/' $f; perl -p -i -e 's/\*1284DeviceId/*1284DeviceID/' $f; done
# Compress the PostScript PPDs in a self-extracting archive
pyppd -v -o $CRAFT_PART_INSTALL/foomatic-ps-ppds db/source/PPD
craftctl default
build-packages:
- perl-base
- python3
- xz-utils
- curl
stage-packages:
- python3
- xz-utils
- pyppd
organize:
foomatic-ps-ppds: usr/share/ppd/foomatic-ps-ppds
stage:
- usr/bin
- usr/share/ppd
prime:
- usr/bin/xz
- -usr/bin/pdb3
- -usr/bin/pydoc3
- -usr/bin/pygettext3
- usr/share/ppd
after: [pyppd]
hplip:
# We need only the PostScript printer PPD files and the hpps
# filter executable (for support for PIN-secured printing). We
# clean up the PPDs from some common errors and as the hpps
# executable is very simple, we do not run "./configure; make;
# make install" but call gcc directly instead.
#
# We use the Debian package source instead of the upstream source code
# of HPLIP as the Debian package has ~80 patches fixing bugs which are
# reported upstream but the patches not adopted upstream.
# This way we should have the same user experience in terms of reliability
# and quality as with the Debian package.
# Note that the repository has all patches already applied, so we do
# not need to apply them before building.
# Debian source
source: https://salsa.debian.org/printing-team/hplip.v2.git
source-type: git
source-tag: 'debian/3.22.10+dfsg0-5'
source-depth: 1
# ext:updatesnap
# version-format:
# format: 'debian/%V'
# Upstream source
#source: https://sourceforge.net/projects/hplip/files/hplip/3.22.10/hplip-3.22.10.tar.gz
plugin: nil
override-build: |
set -eux
cd prnt/hpps
touch config.h
gcc -o hpps *.c -I. -I$CRAFT_STAGE/usr/include/ -L$CRAFT_STAGE/usr/lib/ -lcups
rm config.h
cd ../..
mkdir -p $CRAFT_PART_INSTALL
cp prnt/hpps/hpps $CRAFT_PART_INSTALL
# Remove executable bits from PPD files
find prnt/ps -executable -type f -print0 | xargs -0 chmod -x || :
# Remove non-PPD files from PPD file directories
find prnt/ps -type f \! -name '*.ppd*' -print0 | xargs -0 rm || :
# Unzip the PPD files (for upstream source)
# find prnt/ps -type f -name '*.ppd.gz' -print0 | xargs -0 gunzip || :
# Correct common errors in PPD files: "*CloseUI" without ':' and
# "*1284DeviceId" instead of "*1284DeviceID"
for f in `find prnt/ps -name '*.ppd'`; do perl -p -i -e 's/^\*CloseUI(\s+)/*CloseUI:\1/' $f; perl -p -i -e 's/\*1284DeviceId/*1284DeviceID/' $f; done
# Compress the PostScript PPDs in a self-extracting archive
pyppd -v -o $CRAFT_PART_INSTALL/hplip-ps-ppds prnt/ps
craftctl default
build-packages:
- perl-base
- python3
- xz-utils
stage-packages:
- python3
- xz-utils
- pyppd
organize:
hplip-ps-ppds: usr/share/ppd/hplip-ps-ppds
hpps: usr/lib/ps-printer-app/filter/hpps
stage:
- usr/bin
- usr/share/ppd
- usr/lib/ps-printer-app
prime:
- usr/bin/xz
- -usr/bin/pdb3
- -usr/bin/pydoc3
- -usr/bin/pygettext3
- usr/share/ppd
- usr/lib/ps-printer-app
after: [cups, pyppd]
ps-printer-app:
plugin: make
source: .
make-parameters:
- LDFLAGS="$LDFLAGS -ljpeg"
- VERSION="$VERSION"
# To find the libraries built in this Snap
build-environment:
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib"
# To improve convenience for developers (and everyone who wants to
# build from source), we do a "make clean" before "make" here,
# because if we had done "make" off-Snap, directly in the source
# tree and afterwards build the Snap with snapcraft, the build
# sucks in our local binary of ps-printer-app instead of
# compiling its own one in the Snap harness with the appropriate
# libraries, ending up with the Snap containing an executable
# which does not work inside the Snap. The "make clean" removes
# any accidentally grabbed binary.
#
# We need to directly call the "make" and "make install" commands
# here as we cannot inject an environment variable into the default
# build process ("craftctl default") and we also cannot call
# "craftctl get version" in the lines of "make-parameters:" or
# "build-environment:". This way we get the version number of our
# Snap (which is extracted from the foomatic-db upstream source)
# into the ps-printer-app executable.
override-build: |
set -eux
make clean
VERSION="`craftctl get version`"
make -j"8" LDFLAGS="$LDFLAGS -ljpeg" VERSION="$VERSION"
make -j"8" install LDFLAGS="$LDFLAGS -ljpeg" VERSION="$VERSION" DESTDIR="$CRAFT_PART_INSTALL"
#craftctl default
build-packages:
- libusb-1.0-0-dev
stage-packages:
- libusb-1.0-0
- libjbig0
- liblcms2-2
- libtiff5
- libwebp7
stage:
- -usr/lib/ps-printer-app
prime:
- usr/bin/ps-printer-app
- lib/*/lib*.so*
- usr/lib/*/lib*.so*
- usr/share/ps-printer-app
- usr/share/ppd
- -var
- -usr/share/man
after: [pappl-retrofit, pappl, libcupsfilters, libppd, cups-filters, foomatic-db, hplip]
avahi-daemon:
plugin: nil
overlay-packages:
- avahi-daemon
- avahi-utils
- libnss-mdns
- mdns-scan
- dbus
- python3
utils:
plugin: nil
overlay-packages:
- python3
scripts:
plugin: dump
source: scripts/
organize:
run-dbus.sh: /scripts/run-dbus.sh
start-server.sh: /scripts/start-server.sh
override-prime: |
set -eux
craftctl default
# Ensure the run-dbus.sh script has executable permissions
if [ -f "$CRAFT_PRIME/scripts/run-dbus.sh" ]; then
chmod +x "$CRAFT_PRIME/scripts/run-dbus.sh"
fi
# Ensure the start-server.sh script has executable permissions
if [ -f "$CRAFT_PRIME/scripts/start-server.sh" ]; then
chmod +x "$CRAFT_PRIME/scripts/start-server.sh"
fi