Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packages: build zlib and zlib-devel #1523

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/libz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "libz"
version = "0.1.0"
edition = "2018"
publish = false
build = "build.rs"

[lib]
path = "pkg.rs"

[[package.metadata.build-package.external-files]]
url = "https://www.zlib.net/zlib-1.2.11.tar.xz"
sha512 = "b7f50ada138c7f93eb7eb1631efccd1d9f03a5e77b6c13c8b757017b2d462e19d2d3e01c50fad60a4ae1bc86d431f6f94c72c11ff410c25121e571953017cb67"

[build-dependencies]
glibc = { path = "../glibc" }
9 changes: 9 additions & 0 deletions packages/libz/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::process::{exit, Command};

fn main() -> Result<(), std::io::Error> {
let ret = Command::new("buildsys").arg("build-package").status()?;
if !ret.success() {
exit(1);
}
Ok(())
}
50 changes: 50 additions & 0 deletions packages/libz/libz.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Name: %{_cross_os}libz
Version: 1.2.11
Release: 1%{?dist}
Summary: Library for zlib compression
URL: https://www.zlib.net/
License: Zlib
Source: https://www.zlib.net/zlib-%{version}.tar.xz
BuildRequires: %{_cross_os}glibc-devel

%description
%{summary}.

%package devel
Summary: Files for development using the library for zlib compression
Requires: %{name}

%description devel
%{summary}.

%prep
%setup -n zlib-%{version}

# Sets cross build flags, target cross compiler, and env variables
# required to `make install` libz
%global set_env \
%set_cross_build_flags \\\
export CROSS_PREFIX="%{_cross_target}-" \\\
%{nil}

%build
%set_env
# zlib only reads prefix from this argument, not the environment
./configure --prefix='%{_cross_prefix}'
%make_build

%install
%set_env
%make_install

%files
%license README
%{_cross_attribution_file}
%{_cross_libdir}/*.so.*
%exclude %{_cross_mandir}

%files devel
%{_cross_libdir}/*.so
%{_cross_includedir}/*.h
%{_cross_libdir}/*.a
%{_cross_pkgconfigdir}/*.pc
1 change: 1 addition & 0 deletions packages/libz/pkg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// not used