From 0605c0aa10592299058c2008a3ed8d93206f4584 Mon Sep 17 00:00:00 2001 From: Magnus Hallin Date: Sat, 12 Aug 2017 11:17:17 +0200 Subject: [PATCH] Add opam package metadata and install/uninstall targets --- LICENSE | 29 +++++++++++++++++++++++++++++ Makefile | 8 ++++++++ graphql_ppx.install | 1 + opam | 25 +++++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 LICENSE create mode 100644 graphql_ppx.install create mode 100644 opam diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..7fe0c529 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2017, Magnus Hallin +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/Makefile b/Makefile index 510a445e..5abe7679 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +PREFIX?=$(shell opam config var prefix) + build: ocamlbuild -package ocaml-migrate-parsetree -package result -package yojson -I lib graphql_ppx.native @@ -6,6 +8,12 @@ test: build # ocamlbuild -package ounit -I tests test.native # ./test.native +install: build + @opam-installer --prefix=$(PREFIX) graphql_ppx.install + +uninstall: + @opam-installer -u --prefix=$(PREFIX) graphql_ppx.install + clean: rm -rf _build graphql_ppx.native diff --git a/graphql_ppx.install b/graphql_ppx.install new file mode 100644 index 00000000..636ade66 --- /dev/null +++ b/graphql_ppx.install @@ -0,0 +1 @@ +bin: "graphql_ppx.native" \ No newline at end of file diff --git a/opam b/opam new file mode 100644 index 00000000..6ab9d87c --- /dev/null +++ b/opam @@ -0,0 +1,25 @@ +opam-version: "1.2" +name: "graphql_ppx" +version: "0.0.1" +maintainer: "Magnus Hallin " +authors: "Magnus Hallin " +homepage: "https://github.com/mhallin/graphql_ppx" +bug-reports: "https://github.com/mhallin/graphql_ppx/issues" +license: "BSD 3-clause" +dev-repo: "https://github.com/mhallin/graphql_ppx" +tags: ["bucklescript" "reasonml" "ppx" "graphql"] +build: [ + [make "build"] + [make "install"] +] +remove: [ + [make "uninstall"] +] +depends: [ + "ocamlfind" {build} + "ocamlbuild" {build} + "ocaml-migrate-parsetree" {build} + "result" {build} + "yojson" {build} + "ppx_tools" {test} +]