Skip to content

Commit 14637af

Browse files
committed
Simplifying the cdt recipe.
1 parent 87ec6b7 commit 14637af

3 files changed

Lines changed: 27 additions & 23 deletions

File tree

tests/test-recipes/metadata/cdt_linking/build.sh

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,29 @@
33
set -x
44

55
# Simple test that CDT packages can be linked
6-
# Compile a minimal program that links against X11 from CDT packages
7-
echo -e "#include <X11/Xlib.h>\nint main() { Display *d = XOpenDisplay(NULL); if (d) XCloseDisplay(d); return 0; }">x11_test.c
8-
${CC} -o ${PREFIX}/bin/links-to-x11-cdt -x c -I${PREFIX}/include -L${PREFIX}/lib -lX11 -lxcb -Wl,-rpath-link,${PREFIX}/lib x11_test.c
9-
find ${PREFIX} -name "libX11*"
6+
# Compile a minimal program that links against PAM and libselinux from CDT packages
7+
cat > cdt_test.c << 'EOF'
8+
#include <stddef.h>
9+
#include <security/pam_appl.h>
10+
#include <selinux/selinux.h>
11+
12+
int main() {
13+
// Test PAM - just check that the header is available
14+
const char *pam_strerror_result = pam_strerror(NULL, 0);
15+
(void)pam_strerror_result; // Suppress unused variable warning
16+
17+
// Test libselinux - check if SELinux is enabled
18+
int selinux_enabled = is_selinux_enabled();
19+
(void)selinux_enabled; // Suppress unused variable warning
20+
21+
return 0;
22+
}
23+
EOF
24+
25+
${CC} -o ${PREFIX}/bin/links-to-cdt -I${PREFIX}/include -L${PREFIX}/lib \
26+
-lpam -lselinux -Wl,-rpath-link,${PREFIX}/lib cdt_test.c
27+
28+
# Verify the libraries are present
29+
find ${PREFIX} -name "libpam*"
30+
find ${PREFIX} -name "libselinux*"
1031
find ${PREFIX} -name "libc.so*"
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
channel_sources:
2-
- conda-forge
3-
channel_targets:
4-
- conda-forge main
5-
61
cdt_name: # [linux]
7-
- conda # [linux]
2+
- el8 # [linux]

tests/test-recipes/metadata/cdt_linking/meta.yaml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,5 @@ build:
1010
requirements:
1111
build:
1212
- {{ compiler('c') }}
13-
- pkg-config
14-
- {{ cdt('libxcb') }}
13+
- {{ cdt('pam-devel') }}
1514
- {{ cdt('libselinux-devel') }}
16-
- {{ cdt('libxi-devel') }}
17-
- {{ cdt('libx11-devel') }}
18-
- {{ cdt('libxau-devel') }}
19-
- {{ cdt('libxext-devel') }}
20-
- {{ cdt('libxfixes-devel') }}
21-
- {{ cdt('mesa-libgl-devel') }}
22-
- {{ cdt('xorg-x11-proto-devel') }}
23-
- {{ cdt('mesa-dri-drivers') }}
24-
- {{ cdt('libxdamage-devel') }}
25-
- {{ cdt('libxxf86vm') }}
26-
- expat

0 commit comments

Comments
 (0)