cmocka-2025-08-06-15-32 — cmocka (#12360)

* Add unbuilt cmocka to cmocka-2025-08-06-15-32

* Update cmocka package file.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update binary_compression

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* cmocka-2025-08-06-15-32: Build Run on linux/386.

* cmocka-2025-08-06-15-32: Package File Update Run on linux/386 container.

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: satmandu <satmandu@users.noreply.github.com>
Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
This commit is contained in:
chromebrew-actions[bot]
2025-08-06 17:45:05 +00:00
committed by GitHub
parent b8fb8d6821
commit 961212fb97

View File

@@ -1,46 +1,31 @@
# Adapted from Arch Linux cmocka PKGBUILD at:
# https://github.com/archlinux/svntogit-community/raw/packages/cmocka/trunk/PKGBUILD
require 'package'
require 'buildsystems/cmake'
class Cmocka < Package
class Cmocka < CMake
description 'Elegant unit testing framework for C with support for mock objects'
homepage 'https://cmocka.org/'
version '1.1.5'
version '1.1.8'
license 'Apache-2.0'
compatibility 'all'
source_url 'https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz'
source_sha256 'f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6'
binary_compression 'tar.xz'
binary_compression 'tar.zst'
binary_sha256({
aarch64: '3697a4226d1da0acfd5f462f645eb31886e41ade46c10b4ba211367c55f5b820',
armv7l: '3697a4226d1da0acfd5f462f645eb31886e41ade46c10b4ba211367c55f5b820',
i686: '615a38e2ca90d0c80d391f68994a0abe461152029e1b33b8a70f53a60b4eb212',
x86_64: 'cb38f5c12d18bef0836dbbb36309da030aedb6275aca3ec610fabf987450ef56'
aarch64: '377206b2a3535eb15f45878d96d9b100a175de623616b3fcf71e17ab679198c5',
armv7l: '377206b2a3535eb15f45878d96d9b100a175de623616b3fcf71e17ab679198c5',
i686: 'f1fa76c44de13364903b2e3cd8a3fd49dde9c20600ff4c810c389118fd4e596e',
x86_64: 'cf3cc34b349ac21ae5aaaa800b139cb5f22b7a016039ac7af8c78c3224aa0354'
})
depends_on 'glibc' # R
depends_on 'llvm_dev' => :build
cmake_options '-DUNIT_TESTING=ON'
def self.patch
system "sed -i 's/-fstack-protector-strong/-fno-stack-protector/g' CompilerChecks.cmake"
end
def self.build
Dir.mkdir 'builddir'
Dir.chdir 'builddir' do
# See GCC linking issue w/ LTO here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88643
system "env CC=clang CFLAGS='-pipe -fno-stack-protector -U_FORTIFY_SOURCE -fuse-ld=lld -flto' \
CXXFLAGS='-pipe -fno-stack-protector -U_FORTIFY_SOURCE -fuse-ld=lld -flto' \
LDFLAGS='-fno-stack-protector -U_FORTIFY_SOURCE -fuse-ld=lld -flto' \
cmake \
-G Ninja \
#{CREW_CMAKE_OPTIONS} \
-DUNIT_TESTING=ON \
.."
end
system 'ninja -C builddir'
end
def self.install
system "DESTDIR=#{CREW_DEST_DIR} ninja -C builddir install"
end
end