Skip to content

Commit dfb2792

Browse files
committed
fix: ensure PAPPL is detected by configuring PKG_CONFIG_PATH
1 parent 4aa4fd5 commit dfb2792

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze (C/C++)
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [ 'cpp' ]
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v4
30+
with:
31+
languages: ${{ matrix.language }}
32+
queries: +security-and-quality
33+
34+
- name: Install dependencies
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y \
38+
build-essential \
39+
autoconf \
40+
automake \
41+
autopoint \
42+
libtool \
43+
pkg-config \
44+
git \
45+
libjpeg-dev \
46+
libpng-dev \
47+
zlib1g-dev \
48+
libcupsfilters-dev \
49+
libavahi-client-dev \
50+
libcups2-dev
51+
52+
- name: Install CUPS (latest)
53+
run: |
54+
git clone https://github.com/OpenPrinting/cups.git
55+
cd cups
56+
./configure
57+
make -j$(nproc)
58+
sudo make install
59+
sudo ldconfig
60+
61+
- name: Export CUPS paths
62+
run: |
63+
echo "/usr/local/bin" >> $GITHUB_PATH
64+
echo "/usr/local/sbin" >> $GITHUB_PATH
65+
66+
- name: Install PAPPL and Build project
67+
run: |
68+
69+
# Install PAPPL
70+
git clone https://github.com/michaelrsweet/pappl.git
71+
cd pappl
72+
./configure --enable-shared
73+
make -j$(nproc)
74+
sudo make install
75+
sudo ldconfig
76+
cd ..
77+
78+
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig" >> $GITHUB_ENV
79+
80+
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
81+
82+
# Verify PAPPL
83+
pkg-config --modversion pappl
84+
85+
# Build project
86+
./autogen.sh || true
87+
./configure CUPS_CONFIG=/usr/local/bin/cups-config
88+
make -j$(nproc)
89+
90+
- name: Perform CodeQL Analysis
91+
uses: github/codeql-action/analyze@v4
92+
with:
93+
category: "/language:${{ matrix.language }}"
94+

0 commit comments

Comments
 (0)