Skip to content

Commit

Permalink
[infra/gbs] Symbolic link for pc file (#14411)
Browse files Browse the repository at this point in the history
This commit updates spec file to use symbolic link for pc file.
It changes pc file name.
It includes workflow fix to check packaging directory changes.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Dec 5, 2024
1 parent 669d509 commit f19b018
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/run-onert-gbs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- 'infra/nnfw/**'
- 'infra/cmake/**'
- 'runtime/**'
- 'packaging/**'
- 'tests/**'
- '!**.md'
push:
Expand All @@ -33,6 +34,7 @@ on:
- 'infra/nnfw/**'
- 'infra/cmake/**'
- 'runtime/**'
- 'packaging/**'
- 'tests/**'
- '!**.md'

Expand Down
6 changes: 2 additions & 4 deletions infra/debian/runtime/rules
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ override_dh_auto_install:
./nnfw install --prefix $(NNFW_INSTALL_PREFIX) --strip
override_dh_install:
install -d $(NNFW_INSTALL_PREFIX)/lib/pkgconfig
install -m 0644 packaging/nnfw.pc.in -T $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert.pc
install -m 0644 packaging/nnfw-plugin.pc.in -T $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert-plugin.pc
install -m 0644 packaging/onert.pc.in -T $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert.pc
install -m 0644 packaging/onert-plugin.pc.in -T $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert-plugin.pc
sed -i 's:@libdir@:\/usr\/lib:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert.pc
sed -i 's:@includedir@:\/usr\/include:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert.pc
sed -i 's:@version@:${DEBVER}:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert.pc
sed -i 's:Name\: nnfw:Name\: onert:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert.pc
sed -i 's:@libdir@:\/usr\/lib:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert-plugin.pc
sed -i 's:@includedir@:\/usr\/include:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert-plugin.pc
sed -i 's:@version@:${DEBVER}:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert-plugin.pc
sed -i 's:Name\: nnfw:Name\: onert:g' $(NNFW_INSTALL_PREFIX)/lib/pkgconfig/onert-plugin.pc
dh_install
18 changes: 12 additions & 6 deletions packaging/nnfw.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ License: Apache-2.0 and MIT and BSD-2-Clause and MPL-2.0
Source0: %{name}-%{version}.tar.gz
Source1: %{name}.manifest
Source1001: nnapi_test_generated.tar.gz
Source2001: nnfw.pc.in
Source2002: nnfw-plugin.pc.in
Source2001: onert.pc.in
Source2002: onert-plugin.pc.in
Source3001: ABSEIL.tar.gz
Source3002: CPUINFO.tar.gz
Source3003: FARMHASH.tar.gz
Expand Down Expand Up @@ -243,13 +243,17 @@ cp %{SOURCE2001} .
cp %{SOURCE2002} .
sed -i 's:@libdir@:%{_libdir}:g
s:@includedir@:%{_includedir}:g
s:@version@:%{version}:g' ./nnfw.pc.in
s:@version@:%{version}:g' ./onert.pc.in
sed -i 's:@libdir@:%{_libdir}:g
s:@includedir@:%{_includedir}:g
s:@version@:%{version}:g' ./nnfw-plugin.pc.in
s:@version@:%{version}:g' ./onert-plugin.pc.in
mkdir -p %{buildroot}%{_libdir}/pkgconfig
install -m 0644 ./nnfw.pc.in %{buildroot}%{_libdir}/pkgconfig/nnfw.pc
install -m 0644 ./nnfw-plugin.pc.in %{buildroot}%{_libdir}/pkgconfig/nnfw-plugin.pc
install -m 0644 ./onert.pc.in %{buildroot}%{_libdir}/pkgconfig/onert.pc
install -m 0644 ./onert-plugin.pc.in %{buildroot}%{_libdir}/pkgconfig/onert-plugin.pc
pushd %{buildroot}%{_libdir}/pkgconfig
ln -sf onert.pc nnfw.pc
ln -sf onert-plugin.pc nnfw-plugin.pc
popd

%if %{test_build} == 1
mkdir -p %{test_install_path}/bin
Expand Down Expand Up @@ -308,6 +312,7 @@ install -m 644 build/out/lib/nnfw/odc/*.so %{buildroot}%{_libdir}/nnfw/odc
%dir %{_includedir}/nnfw
%{_includedir}/nnfw/*
%{_libdir}/pkgconfig/nnfw.pc
%{_libdir}/pkgconfig/onert.pc
%endif

%files plugin-devel
Expand All @@ -317,6 +322,7 @@ install -m 644 build/out/lib/nnfw/odc/*.so %{buildroot}%{_libdir}/nnfw/odc
%dir %{_includedir}/onert
%{_includedir}/onert/*
%{_libdir}/pkgconfig/nnfw-plugin.pc
%{_libdir}/pkgconfig/onert-plugin.pc
%endif

%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: nnfw-plugin
Name: onert-plugin
Description: onert plugin API
Version: @version@
Libs: -L@libdir@ -lonert_core
Expand Down
2 changes: 1 addition & 1 deletion packaging/nnfw.pc.in → packaging/onert.pc.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: nnfw
Name: onert
Description: onert API
Version: @version@
Libs: -L@libdir@ -lonert
Expand Down

0 comments on commit f19b018

Please sign in to comment.