Skip to content

Commit

Permalink
fixup! test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-carlborg committed Dec 23, 2023
1 parent 94892aa commit b8bca80
Showing 1 changed file with 48 additions and 47 deletions.
95 changes: 48 additions & 47 deletions ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def fetch

def build
FileUtils.mkdir_p "qemu/build"
libslirp.build
# libslirp.build

Dir.chdir "qemu/build" do
target_list = enabled_architectures.map { "#{_1.name}-softmmu" }.join(",")
Expand Down Expand Up @@ -251,50 +251,50 @@ def enabled_architectures
ci_runner.enabled_architectures.map { _1.new(self) }
end

class Libslirp
def build
uninstall

Dir.chdir(temp_dir) do
fetch
_build
end
end

def ldflags
[File.join(target_path, "build", "libslirp.a")]
end

def cleanup
FileUtils.remove_entry(temp_dir)
end

private

def temp_dir
@temp_dir ||= Dir.mktmpdir
end

def target_path
@target_path ||= File.join(temp_dir, "libslirp-master")
end

def fetch
download_file("https://gitlab.com/qemu-project/libslirp/-/archive/master/libslirp-master.tar", "libslirp.tar")
execute "tar", "-xf", "libslirp.tar"
end

def _build
Dir.chdir(target_path) do
execute "meson", "setup", "-Ddefault_library=static", "build"
execute "ninja", "-C", "build", "install"
end
end

def uninstall
execute "brew", "uninstall", "--ignore-dependencies", "libslirp"
end
end
# class Libslirp
# def build
# uninstall
#
# Dir.chdir(temp_dir) do
# fetch
# _build
# end
# end
#
# def ldflags
# [File.join(target_path, "build", "libslirp.a")]
# end
#
# def cleanup
# FileUtils.remove_entry(temp_dir)
# end
#
# private
#
# def temp_dir
# @temp_dir ||= Dir.mktmpdir
# end
#
# def target_path
# @target_path ||= File.join(temp_dir, "libslirp-master")
# end
#
# def fetch
# download_file("https://gitlab.com/qemu-project/libslirp/-/archive/master/libslirp-master.tar", "libslirp.tar")
# execute "tar", "-xf", "libslirp.tar"
# end
#
# def _build
# Dir.chdir(target_path) do
# execute "meson", "setup", "-Ddefault_library=static", "build"
# execute "ninja", "-C", "build", "install"
# end
# end
#
# def uninstall
# execute "brew", "uninstall", "--ignore-dependencies", "libslirp"
# end
# end
end

class CIRunner
Expand Down Expand Up @@ -386,7 +386,7 @@ def bundle_uefi(firmware_target_dir)
end

def install_prerequisite
packages = %w[ninja pixman glib meson]
packages = %w[ninja pixman glib meson libslirp]
execute "brew", "install", *packages, env: { HOMEBREW_NO_INSTALL_CLEANUP: true }
patch_glib_python_codegen
end
Expand Down Expand Up @@ -445,7 +445,8 @@ def ldflags
"#{brew_prefix}/opt/glib/lib/libgmodule-2.0.a",
"#{brew_prefix}/opt/glib/lib/libgobject-2.0.a",
"#{brew_prefix}/opt/pixman/lib/libpixman-1.a",
"#{brew_prefix}/lib/libpcre2-8.a"
"#{brew_prefix}/lib/libpcre2-8.a",
"#{brew_prefix}/lib/libslirp.a"
]
end

Expand Down

0 comments on commit b8bca80

Please sign in to comment.