From patchwork Tue Aug 25 17:58:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 275643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A281CC433E1 for ; Tue, 25 Aug 2020 17:59:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A492207BC for ; Tue, 25 Aug 2020 17:59:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hC558ciS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A492207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAdEJ-0000ed-Kj for qemu-devel@archiver.kernel.org; Tue, 25 Aug 2020 13:59:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAdDb-0007z9-Vr for qemu-devel@nongnu.org; Tue, 25 Aug 2020 13:58:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:24730 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAdDa-0003Qv-1e for qemu-devel@nongnu.org; Tue, 25 Aug 2020 13:58:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598378324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6co6dqqFbt+M+9vp8wQuYLG4bX1PgrCFXyEUrd8kagY=; b=hC558ciSjjU+tlWgu4xFENDp1kZOBOZkUXYxOM/Pbbu1TNbxWbBuAYLW+O7b34DwFe1/0g kupSht9FmXGw2bVHaQ38+jzePsocS6bzo2hwOJKxRXzVxW39hS5WF5YN8cZSUFoENJ8YDc JsLrxv34t+BCl+SbmQsicNYaEyB/35s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-ddvPdwPmO3uX0ia9HGIVQA-1; Tue, 25 Aug 2020 13:58:42 -0400 X-MC-Unique: ddvPdwPmO3uX0ia9HGIVQA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E1FE1DDE0; Tue, 25 Aug 2020 17:58:42 +0000 (UTC) Received: from localhost (unknown [10.36.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BBC25D9D3; Tue, 25 Aug 2020 17:58:37 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 1/5] meson: pass confsuffix option Date: Tue, 25 Aug 2020 21:58:23 +0400 Message-Id: <20200825175827.355940-2-marcandre.lureau@redhat.com> In-Reply-To: <20200825175827.355940-1-marcandre.lureau@redhat.com> References: <20200825175827.355940-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 01:37:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.958, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de, berrange@redhat.com, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau The following patches will make use of it to fix installation paths. Signed-off-by: Marc-André Lureau --- configure | 1 + meson_options.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/configure b/configure index b1e11397a8..e19e2de2f0 100755 --- a/configure +++ b/configure @@ -8222,6 +8222,7 @@ NINJA=$PWD/ninjatool $meson setup \ --mandir "${pre_prefix}$mandir" \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ + -Dconfsuffix="$confsuffix" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ diff --git a/meson_options.txt b/meson_options.txt index c55f9cd94c..7bb2c0fca9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ +option('confsuffix', type : 'string', value: 'qemu') option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto') From patchwork Tue Aug 25 17:58:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 275642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1AC9C433E1 for ; Tue, 25 Aug 2020 18:00:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B27A020782 for ; Tue, 25 Aug 2020 18:00:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R7n5tZAq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B27A020782 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAdEr-0001eO-Vi for qemu-devel@archiver.kernel.org; Tue, 25 Aug 2020 14:00:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAdDs-0008SU-Va for qemu-devel@nongnu.org; Tue, 25 Aug 2020 13:59:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAdDr-0003T6-4o for qemu-devel@nongnu.org; Tue, 25 Aug 2020 13:59:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598378342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=408pICv+ubcqoi+Lk7I4/D0jqt+4yOugK8fHMuPjHi4=; b=R7n5tZAqc7CQ/c1wt16frsI/FUXRgUNwNnJ91ZKRYmE0SBcJF9IWSOd75YU6nPnsz+AHU1 /m1LdeZzYkVU0XPRfxQOl9yrUy5N4ljR76oMzGYmvxQfYyMwsTebolpoN6dmNjQWROrcUM fZ71da8DByGld1dhUCS5ln1KtigI9vo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-36-kiee9qI9Pn25aNVQU3QrHw-1; Tue, 25 Aug 2020 13:58:56 -0400 X-MC-Unique: kiee9qI9Pn25aNVQU3QrHw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80FEA1007467; Tue, 25 Aug 2020 17:58:55 +0000 (UTC) Received: from localhost (unknown [10.36.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C1486FEDC; Tue, 25 Aug 2020 17:58:54 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 3/5] meson: add docdir option and pass pre-prefix qemu_docdir Date: Tue, 25 Aug 2020 21:58:25 +0400 Message-Id: <20200825175827.355940-4-marcandre.lureau@redhat.com> In-Reply-To: <20200825175827.355940-1-marcandre.lureau@redhat.com> References: <20200825175827.355940-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 06:38:59 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.958, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de, berrange@redhat.com, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau When cross-compiling, by default qemu_docdir is 'c:\Program Files\QEMU\' which is not recognized as being an absolute path, and meson will end up adding the prefix again. Add an option to pass docdir location to meson, pre-prefixed like we do with other directories and use that instead of config_host['qemu_docdir']. Signed-off-by: Marc-André Lureau --- configure | 1 + docs/meson.build | 4 ++-- meson.build | 3 ++- meson_options.txt | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure b/configure index e19e2de2f0..e644841299 100755 --- a/configure +++ b/configure @@ -8223,6 +8223,7 @@ NINJA=$PWD/ninjatool $meson setup \ --sysconfdir "${pre_prefix}$sysconfdir" \ --localstatedir "${pre_prefix}$local_statedir" \ -Dconfsuffix="$confsuffix" \ + -Ddocdir="${pre_prefix}$qemu_docdir" \ -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ diff --git a/docs/meson.build b/docs/meson.build index 8b059a8e39..e27f4632dc 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -10,7 +10,7 @@ if build_docs configure_file(output: 'index.html', input: files('index.html.in'), configuration: {'VERSION': meson.project_version()}, - install_dir: config_host['qemu_docdir']) + install_dir: get_option('docdir')) manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ] man_pages = { 'interop' : { @@ -48,7 +48,7 @@ if build_docs input_dir, output_dir]) sphinxdocs += this_manual if build_docs and manual != 'devel' - install_subdir(output_dir, install_dir: config_host['qemu_docdir']) + install_subdir(output_dir, install_dir: get_option('docdir')) endif these_man_pages = [] diff --git a/meson.build b/meson.build index 20f20a7bfc..33281cecc3 100644 --- a/meson.build +++ b/meson.build @@ -1170,7 +1170,7 @@ if build_docs input: input, output: output, install: true, - install_dir: config_host['qemu_docdir'] / 'interop', + install_dir: get_option('docdir') / 'interop', command: cmd + args) endforeach alias_target(ext, t) @@ -1233,6 +1233,7 @@ if targetos != 'windows' else summary_info += {'local state directory': 'queried at runtime'} endif +summary_info += {'Doc directory': get_option('docdir')} summary_info += {'Build directory': meson.current_build_dir()} summary_info += {'Source path': meson.current_source_dir()} summary_info += {'GIT binary': config_host['GIT']} diff --git a/meson_options.txt b/meson_options.txt index 7bb2c0fca9..fb9312fddd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,5 @@ option('confsuffix', type : 'string', value: 'qemu') +option('docdir', type : 'string', value : 'doc/qemu') option('gettext', type : 'boolean', value : true) option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto') From patchwork Tue Aug 25 17:58:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 275641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FC06C433E1 for ; Tue, 25 Aug 2020 18:02:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2515E20715 for ; Tue, 25 Aug 2020 18:02:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dGvztryY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2515E20715 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAdH6-000436-Cd for qemu-devel@archiver.kernel.org; Tue, 25 Aug 2020 14:02:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAdE4-0000Vg-OP for qemu-devel@nongnu.org; Tue, 25 Aug 2020 13:59:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAdE2-0003Tr-CT for qemu-devel@nongnu.org; Tue, 25 Aug 2020 13:59:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598378353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9Yht4X/+ViXbgjzJlQR/gjv+vQ6cj6WUvGJ0e7LvyYw=; b=dGvztryYVqi+WnbkYA4OfiFoANQlGOdYsDOrgKDrpHMChvydeOH/ELY3DMeG0Bw0Ysqj9A R+m1GFHlpKjECL0FOnTcc86/7GNtiNXU951vPBdAv/M/Ik3Z2hQyYIA3UxwO6OHh/Nkop5 RaDq5Dc1SGPpD+jLyyyBrMrvJd334BU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-551-mVcP5CXUNDSF1TXhXeoDSA-1; Tue, 25 Aug 2020 13:59:09 -0400 X-MC-Unique: mVcP5CXUNDSF1TXhXeoDSA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDB9D10082E7; Tue, 25 Aug 2020 17:59:08 +0000 (UTC) Received: from localhost (unknown [10.36.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9918A1002D48; Tue, 25 Aug 2020 17:59:07 +0000 (UTC) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 5/5] meson: add NSIS building Date: Tue, 25 Aug 2020 21:58:27 +0400 Message-Id: <20200825175827.355940-6-marcandre.lureau@redhat.com> In-Reply-To: <20200825175827.355940-1-marcandre.lureau@redhat.com> References: <20200825175827.355940-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 02:03:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.958, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de, berrange@redhat.com, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- Makefile | 56 ----------------------------------- meson.build | 25 ++++++++++++++++ scripts/nsis.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 56 deletions(-) create mode 100644 scripts/nsis.py diff --git a/Makefile b/Makefile index 81794d5c34..3ebd6929b4 100644 --- a/Makefile +++ b/Makefile @@ -294,62 +294,6 @@ endif "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop" $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" -ifdef CONFIG_WIN32 - -INSTALLER = qemu-setup-$(VERSION)$(EXESUF) - -nsisflags = -V2 -NOCD - -ifneq ($(wildcard $(SRC_PATH)/dll),) -ifeq ($(ARCH),x86_64) -# 64 bit executables -DLL_PATH = $(SRC_PATH)/dll/w64 -nsisflags += -DW64 -else -# 32 bit executables -DLL_PATH = $(SRC_PATH)/dll/w32 -endif -endif - -.PHONY: installer -installer: $(INSTALLER) - -INSTDIR=/tmp/qemu-nsis - -$(INSTALLER): $(SRC_PATH)/qemu.nsi - $(MAKE) install DESTDIR=${INSTDIR} -ifdef SIGNCODE - (cd ${INSTDIR}/${bindir}; \ - for i in *.exe; do \ - $(SIGNCODE) $${i}; \ - done \ - ) -endif # SIGNCODE - (cd ${INSTDIR}/${bindir}; \ - for i in qemu-system-*.exe; do \ - arch=$${i%.exe}; \ - arch=$${arch#qemu-system-}; \ - echo Section \"$$arch\" Section_$$arch; \ - echo SetOutPath \"\$$INSTDIR\"; \ - echo File \"\$${BINDIR}\\$$i\"; \ - echo SectionEnd; \ - done \ - ) >${INSTDIR}/${bindir}/system-emulations.nsh - makensis $(nsisflags) \ - $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \ - $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \ - -DBINDIR="${INSTDIR}/${bindir}" \ - $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \ - -DSRCDIR="$(SRC_PATH)" \ - -DOUTFILE="$(INSTALLER)" \ - -DDISPLAYVERSION="$(VERSION)" \ - $(SRC_PATH)/qemu.nsi - rm -r ${INSTDIR} -ifdef SIGNCODE - $(SIGNCODE) $(INSTALLER) -endif # SIGNCODE -endif # CONFIG_WIN - # Add a dependency on the generated files, so that they are always # rebuilt before other object files ifneq ($(wildcard config-host.mak),) diff --git a/meson.build b/meson.build index 0720a7d684..bc2bea23b2 100644 --- a/meson.build +++ b/meson.build @@ -1217,6 +1217,31 @@ if build_docs endif endif +if host_machine.system() == 'windows' + nsis_cmd = [ + find_program('scripts/nsis.py'), + '@OUTPUT@', + get_option('prefix'), + meson.current_source_dir(), + host_machine.cpu_family(), + '--', + '-DDISPLAYVERSION=' + meson.project_version(), + ] + if build_docs + nsis_cmd += '-DCONFIG_DOCUMENTATION=y' + endif + if 'CONFIG_GTK' in config_host + nsis_cmd += '-DCONFIG_GTK=y' + endif + + nsis = custom_target('nsis', + output: 'qemu-setup-' + meson.project_version() + '.exe', + input: files('qemu.nsi'), + build_always_stale: true, + command: nsis_cmd + ['@INPUT@']) + alias_target('installer', nsis) +endif + summary_info = {} summary_info += {'Install prefix': config_host['prefix']} summary_info += {'BIOS directory': config_host['qemu_datadir']} diff --git a/scripts/nsis.py b/scripts/nsis.py new file mode 100644 index 0000000000..e1c409344e --- /dev/null +++ b/scripts/nsis.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020 Red Hat, Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import argparse +import glob +import os +import shutil +import subprocess +import tempfile + + +def signcode(path): + cmd = os.environ.get("SIGNCODE") + if not cmd: + return + subprocess.run([cmd, path]) + + +def main(): + parser = argparse.ArgumentParser(description="QEMU NSIS build helper.") + parser.add_argument("outfile") + parser.add_argument("prefix") + parser.add_argument("srcdir") + parser.add_argument("cpu") + parser.add_argument("nsisargs", nargs="*") + args = parser.parse_args() + + destdir = tempfile.mkdtemp() + try: + subprocess.run(["make", "install", "DESTDIR=" + destdir + os.path.sep]) + with open( + os.path.join(destdir + args.prefix, "system-emulations.nsh"), "w" + ) as nsh: + for exe in glob.glob( + os.path.join(destdir + args.prefix, "qemu-system-*.exe") + ): + exe = os.path.basename(exe) + arch = exe[12:-4] + nsh.write( + """ + Section "{0}" Section_{0} + SetOutPath "$INSTDIR" + File "${{BINDIR}}\\{1}" + SectionEnd + """.format( + arch, exe + ) + ) + + for exe in glob.glob(os.path.join(destdir + args.prefix, "*.exe")): + signcode(exe) + + makensis = [ + "makensis", + "-V2", + "-NOCD", + "-DSRCDIR=" + args.srcdir, + "-DBINDIR=" + destdir + args.prefix, + ] + dlldir = "w32" + if args.cpu == "x86_64": + dlldir = "w64" + makensis += ["-DW64"] + if os.path.exists(os.path.join(args.srcdir, "dll")): + makensis += "-DDLLDIR={0}/dll/{1}".format(args.srcdir, dlldir) + + makensis += ["-DOUTFILE=" + args.outfile] + args.nsisargs + subprocess.run(makensis) + signcode(args.outfile) + finally: + shutil.rmtree(destdir) + + +if __name__ == "__main__": + main()