Skip to content

Commit

Permalink
Convert to topkg build.
Browse files Browse the repository at this point in the history
  • Loading branch information
haesbaert committed Apr 16, 2017
1 parent 4c8c3ff commit 769bc44
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.byte
*.native
*.cma
_build
rawlink.install
20 changes: 14 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ env:
global:
- PACKAGE="rawlink.9999"
matrix:
- DISTRO="debian-stable" OCAML_VERSION="4.02.3"
- DISTRO="debian-testing" OCAML_VERSION="4.03.0"
- DISTRO="ubuntu-14.04" OCAML_VERSION="4.02.3"
- DISTRO="ubuntu-16.04" OCAML_VERSION="4.02.3"
- DISTRO="centos-7" OCAML_VERSION="4.02.3"
- DISTRO="centos-6" OCAML_VERSION="4.02.3"
- DISTRO="alpine-3.4" OCAML_VERSION="4.03.0"
- DISTRO="alpine-3.4" OCAML_VERSION="4.04.0"
- DISTRO="centos-6" OCAML_VERSION="4.03.0"
- DISTRO="centos-6" OCAML_VERSION="4.04.0"
- DISTRO="centos-7" OCAML_VERSION="4.03.0"
- DISTRO="centos-7" OCAML_VERSION="4.04.0"
- DISTRO="debian-stable" OCAML_VERSION="4.03.0"
- DISTRO="debian-stable" OCAML_VERSION="4.04.0"
- DISTRO="debian-testing" OCAML_VERSION="4.03.0"
- DISTRO="debian-testing" OCAML_VERSION="4.04.0"
- DISTRO="fedora-24" OCAML_VERSION="4.03.0"
- DISTRO="fedora-24" OCAML_VERSION="4.04.0"
- DISTRO="ubuntu-14.04" OCAML_VERSION="4.03.0"
- DISTRO="ubuntu-14.04" OCAML_VERSION="4.04.0"
- DISTRO="ubuntu-16.04" OCAML_VERSION="4.03.0"
- DISTRO="ubuntu-16.04" OCAML_VERSION="4.04.0"
20 changes: 20 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## 0.5 (2017-04-16)

* Convert to topkg

## 0.4 (2016-12-17)

* Convert to ppx

## 0.3 (2015-08-30)

* Fix fd leak in bpf_open
* Fix linux send function

## 0.2 (2015-08-28)

* Fix to bpf_split_buf

## 0.1 (2015-10-09)

* Initial release
File renamed without changes.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Rawlink

A portable library to read and write raw packets.
## Rawlink - portable library to read and write raw packets.

[![Build Status](https://travis-ci.org/haesbaert/rawlink.svg)](https://travis-ci.org/haesbaert/rawlink)

Expand Down
7 changes: 3 additions & 4 deletions _tags
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
true: debug, bin_annot, strict_sequence
true: package(cstruct), package(cstruct.ppx)
true: package(lwt.unix), package(lwt.ppx), ppopt(-lwt-debug)
true: color(auto), debug, bin_annot, strict_sequence
true: package(cstruct cstruct.ppx lwt.unix lwt.ppx)
true: use_rawlink_stubs

"lib": include
<*.byte>: linkdep(rawlink_stubs.o), custom
<*.native>: linkdep(rawlink_stubs.o)
5 changes: 0 additions & 5 deletions all.itarget

This file was deleted.

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

ocamlbuild -no-links -use-ocamlfind all.otarget $@
topkg build
2 changes: 2 additions & 0 deletions doc/api.odocl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Rawlink
Lwt_rawlink
3 changes: 1 addition & 2 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ dispatch begin function
| After_rules ->
pflag ["ocaml";"compile";] "ppopt" (fun s -> S [A"-ppopt"; A s]);
pflag ["ocaml";"ocamldep";] "ppopt" (fun s -> S [A"-ppopt"; A s]);
pdep ["link"] "linkdep" (fun param -> [param]);
(* Linking generated stubs *)
dep ["ocaml"; "link"; "byte"; "library"; "use_rawlink_stubs"]
["lib/dllrawlink_stubs"-.-(!Options.ext_dll)];
flag ["ocaml"; "link"; "byte"; "library"; "use_rawlink_stubs"] &
S[A"-dllib"; A"-lrawlink_stubs"];

pdep ["link"] "linkdep" (fun param -> [param]);
dep ["ocaml"; "link"; "native"; "library"; "use_rawlink_stubs"]
["lib/librawlink_stubs"-.-(!Options.ext_lib)];
flag ["ocaml"; "link"; "native"; "library"; "use_rawlink_stubs"] &
Expand Down
9 changes: 5 additions & 4 deletions opam
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
opam-version: "1.2"
name: "rawlink"
version: "0.4"
maintainer: "Christiano F. Haesbaert <[email protected]>"
authors: "Christiano F. Haesbaert <[email protected]>"
license: "ISC"
homepage: "https://github.com/haesbaert/rawlink"
bug-reports: "https://github.com/haesbaert/rawlink/issues"
license: "ISC"
dev-repo: "https://github.com/haesbaert/rawlink.git"
build: ["sh" "build.sh"]
doc: "https://haesbaert.github.io/rawlink/api"
build: [ "ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" ]
depends: [
"ocamlfind" {build}
"topkg" {build}
"lwt" {>= "2.4.7"}
"cstruct" {>= "1.9"}
"ocamlbuild" {build}
]
depexts: [[ ["alpine"] ["linux-headers"] ]]
available: [ocaml-version >= "4.02.3"]
available: [ocaml-version >= "4.03.0"]

5 changes: 3 additions & 2 deletions lib/META → pkg/META
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version = "0.4"
version = "%%VERSION_NUM%%"
description = "Rawlink is a portable interface to BPF/AF_SOCKET"
requires = "unix lwt.unix lwt cstruct cstruct.ppx"
archive(byte) = "rawlink.cma"
plugin(byte) = "rawlink.cma"
archive(byte, plugin) = "rawlink.cma"
archive(native) = "rawlink.cmxa"
archive(native, plugin) = "rawlink.cmxs"
plugin(native) = "rawlink.cmxs"
exists_if = "rawlink.cma"

14 changes: 14 additions & 0 deletions pkg/pkg.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg

let () =
let opams =
[ Pkg.opam_file "opam" ~lint_deps_excluding:(Some ["ppx_tools" ; "ppx_sexp_conv"]) ]
in
Pkg.describe ~opams "rawlink" @@ fun _ ->
Ok [
Pkg.clib "lib/librawlink_stubs.clib";
Pkg.mllib "lib/rawlink.mllib";
];
23 changes: 0 additions & 23 deletions rawlink.install

This file was deleted.

0 comments on commit 769bc44

Please sign in to comment.